473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

uploading and downloading in asp .net

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!
Nov 18 '05 #1
2 1478
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.

"Matt Mercer" <ma******@bellsouth.net> wrote in message
news:37*************************@posting.google.co m...
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!

Nov 18 '05 #2
You should be able to use Response.WriteFile to implement this
functionality.
Here's more info:
http://msdn.microsoft.com/library/de...efiletopic.asp

These articles might also help your efforts:
http://steve.orr.net/content/asp200307so_f.asp
http://aspalliance.com/das/tutorial/fileupload.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Matt Mercer" <ma******@bellsouth.net> wrote in message
news:37*************************@posting.google.co m...
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!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: TJ | last post by:
Hi, I've written code web-based uploading and downloading. Here is some code for it. For saving file into MS-SQL database, SaveFileIntoDB(HttpPostedFile file) { int fileLength =...
4
by: Himanshu | last post by:
hi, Can anybody tell me that thru asp.net using c#, how can we upload and download physical files in any table of SQL Server Database. the uploading part is running successfully but the...
5
by: Nathan Sokalski | last post by:
I am trying to write code to allow my users to upload a file. The code I am using is as follows: Dim upfilename As String = "" If fileDetails.Value <> "" AndAlso...
6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
3
by: OriginalBrownster | last post by:
I am currently uploading a file from a users computer to the file system on my server using python, just reading the file and writing the binaries. total_data=' ' while True: data =...
0
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am farely new to the perl coding. So as I am doing a project, in that I have a form which have an uploading option that means let me make you all clear that firts we need to fill...
2
by: mike_ni | last post by:
im designing a site (still in my head at the moment) where users will be able to upload photos but I would like somewhere in the upload process, for these photos to be resized down to e.g 600 x 400...
0
by: mivey4 | last post by:
I have been experimenting with sending and receiving files using the webClient class provided in .NET. (C#) I don't seem to have any problems downloading files from my test web server using the...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
3
by: muziburrehaman | last post by:
i am looking for code in php to upload the 1 gb files. any one can please help me by sending the code....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.