Store in SQL - Format of link

Last post 04-16-2008, 1:58 AM by Kai2. 4 replies.
Sort Posts: Previous Next
  •  07-03-2007, 3:31 AM 31225

    Store in SQL - Format of link

    Hi all,

    I've changed the file storage from Filesystem to SQL2000 (as discussed here) but now I have 2 questions regarding the inserted links. I've also tried it on your example page and it's the same result:
    1. The inserted link does not have a meaningfull name. When storing in file system the link contains the name of the file, but when storing in SQL server it's just the link ID (like "http://cutesoft.net/example/SqlSample/DownFile.Aspx?fileid=87") and no one knows which attachment is behind it.

    Is it possible to change it?

    2. As seen above I've added the "Wireless Modem.doc" as FileID 87. But when I click on the link it opens the file in the browser instead of offering a "Save"-Dialog. It is possible to right-click on the link, select "Save Target" and then insert a name like "WordDoc.doc", this works fine. But as described in 1.) the users don't know which attachment type is stored there so they don't even have a workaround. I'm not sure whether this could be solved, but if topic 1.) is fixed my users would at least see that it's a word document and save it on their own (even though it's not very convenient, but currently they don't have any chance to get the attachment in correct format).


    Thanks
    Kai


    .net Framework 4.0 / ASP.net / VB / CuteEditor 6.7 / SQL 2005
  •  07-10-2007, 9:09 AM 31437 in reply to 31225

    Re: Store in SQL - Format of link

    Hi all,

    someone found a solution for this problem?

    Many thanks
    Kai


    .net Framework 4.0 / ASP.net / VB / CuteEditor 6.7 / SQL 2005
  •  07-30-2007, 8:17 AM 31999 in reply to 31437

    Re: Store in SQL - Format of link

    Hi all,

    any chance this might be fixed soon?

    Thanks
    Kai


    .net Framework 4.0 / ASP.net / VB / CuteEditor 6.7 / SQL 2005
  •  04-15-2008, 8:16 PM 39263 in reply to 31225

    Re: Store in SQL - Format of link

    Hi,
     
    the DB provider and the DownFile.aspx is open source.
     
    You can change the code so that you can provide a new url pattern as you like.
     
    for example, in the SqlFileStorage.cs , modify the public override string GetFileUrl(string filepath)
     
    And you can add mime header when the DownFile.aspx is executed.
     
    for example, in the DownFile.aspx.cs , add Response.ContentType="application/msword"; when the file is *.doc
     
    Regards , Terry .
  •  04-16-2008, 1:58 AM 39302 in reply to 39263

    Re: Store in SQL - Format of link

    Hi Cutechat,
     
    thanks for your reply. As my postings are already 9 months old I found a solution in the meantime for the second problem, and I've modified lots of SQLFileStorage.cs (because e.g. it does not make sense to deny storing multiple files with the same filename in an SQL database....) and Downfile.aspx.
     
    But please have a look at the first question: I guess this could not be fixed in a .cs file but in a .js file, probably "Dialog_InsertDocument.js". When a user selects a file to upload, the "Title" should be automatically set to the selected filename. As the filename is retrieved by the script it should not be too difficult for a JS-Expert I think. Could you please have a look at this issue?
     
    Thanks
    Kai


    .net Framework 4.0 / ASP.net / VB / CuteEditor 6.7 / SQL 2005
View as RSS news feed in XML