uploading and downloading in asp .net

M

Matt Mercer

Hi all,

I have a database application (asp .net vb) where I need to upload and
download files to a SQL database. I am not going to store the files in
the database...just the file name. All the files will be in the same
directory. I have searched around the web and found lots of
upload/download tutorials but nothing that is exactly what I need. The
webpage now will successfully upload files but I cannot download them
again. Maybe you all know of some links that would be helpful to be or
possibly some code I can plug into (one can always hope, right?) :)
Thank you!
 
L

Lan H. Nguyen

You could use FileStream to read the file in byte array from where you saved
them then do Response.BinaryWrite( content ) it to browser. This will pop
the download dialog for user to download.

Remember to set response header, for instance:
Response.ContentType = "image/jpeg";
Response.AddHeader("Content-Disposition","attachment;filename=test.jpg");

Hope it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top