Download/Upload file from web server

Results 1 to 2 of 2

Thread: Download/Upload file from web server

  1. #1
    Nikhil Tayal Guest

    Default Download/Upload file from web server

    Hi All,<BR><BR>My problem is:<BR><BR>I need to download a file from my web server(IIS). Then I need to edit the file and then re-upload the edited file to the server. The file formats allowed are doc/txt/rtf/htm/html.<BR><BR>The solutions I tried are:<BR>1. Provide a link to the attached file and open it in the new window. For .doc file, it works fine as it opens the file in an editable mode in word itself. But for txt and html files, it opens it in the browser as plain html and does not allow to edit it.<BR><BR>2. Save the attachment in the client m/c, edit it and upload it again. For this, on click of the link, I&#039;m submitting the form to another form where I&#039;m changing the content-type of the file as "application/msword". This prompts me to save the file in local m/c.<BR>But the problem is that by default it takes the name of other asp file, to which I&#039;m submitting the form, in the filename box of "Save As " window. I don&#039;t want this. I need this to take the actual filename on which I&#039;ve clicked, i.e., the attachment.<BR><BR>I appreciate any efforts you made to provide me with the solution to this thing. Beside these two options, any other solution will also do, the main purpose shud be satisfied.<BR><BR>Thanking you in anticipation.<BR><BR>Nikhil<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Download/Upload file from web server

    Nikhil<BR><BR>Basically you want to set the file name to the file being downloaded for that you have to add <BR><BR>Response.AddHeader "content-disposition","attachment; filename=fname.txt" <BR><BR>I think there is a bug in IE5.5 which ignore this and will not download, but it will work on previous versions and in Netscape. The work around for IE 5.5 is right click the link and select save as.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts