?
Solved

Link updating software that works with files in a database?

Posted on 2012-08-20
2
Medium Priority
?
455 Views
Last Modified: 2012-09-05
I have a website (www.UpToParents.org) that uses a CMS to store files in a database. The files are either pdf, docs, or swf files. I would like to change the filenames of some of the documents that are stored in the database, but many of the swf, doc and pdf files link to these document so I need to be able to identify all places that link to these files and update them accordingly. Dreamweaver does this on sites that consist of files in the Dreamweaver "site."

Does anyone know is there is software available to will check and update links in files that are stored in a MSSQL database?

Thanks
mark
0
Comment
Question by:karnac2020
2 Comments
 
LVL 11

Expert Comment

by:madgino
ID: 38318285
You do this manually using SQL language in SQL management studio.

Possible queries to run are:
select content_column from content_table where content_column like '%your_file_name%'

update content_table
set content_column = Replace(content_column, 'old_file_name', 'new_file_name')
 where content_column like '%old_file_name%'
0
 
LVL 26

Accepted Solution

by:
Alan Warren earned 2000 total points
ID: 38318653
Hi karnac2020,

you should probably look at changing how you serve up the documents from the db, I suspect you are serving them up by 'Name'.

eg:
  Select docBytes from tblDocs where [Name]='Some document name'
should be:
  Select docBytes from tblDocs where [ID]=123

If you had an associated 'ID' field for each document stored in the db, you could request the documents by 'ID', then changing the names of the documents at any time won't affect your document serving processes.

Would need to see some of your code methods used for serving the docs and some associated SQL logic and structure in order to provide a more specific opinion.

It's a good idea to store such docs in a db because asp .net framework and IIS services do not protect files that have an extension which is not associated with .net (.aspx, .config etc...). So even if you put .PDF files into a folder that is protected by the web.config, requiring a login to gain access, IIS will serve up .pdf, .doc and .swf files without hesitation, to any public user who can enter the correct path.

Alan ";0)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question