hai ....

i want to upload the image from my system to database without using fileupload ,

i mean i want to upload the image from specific path for example ("c:\project\image\winter.jpg")..

i use the asp.net C#...

plz reply for my question ,if any one know's ........

the file upload component has a box where you can specify a path (eg. "c:\project\image\winter.jpg"), I would use that

the file upload component has a box where you can specify a path (eg. "c:\project\image\winter.jpg"), I would use that

sorry i can't understand ur answer>>>>>

when you add the file upload control to a web page, there is a text box and a browse button. The textbox allows a user to type in a specific directory path for example:

c:\project\image\winter.jpg

sorry majestic0110......

by using that concept i upload only the path to database, but i want to upload the image to database...

are you trying to upload this image from every visitor of the page or just you?
I dont believe it is possible to upload a file from a visitor, because then nothing would stop you from taking any file off a persons computer.

Hello,

i want to save my image into my image folder
without using fileupload control,
i mean i want to upload the image from specific path for example ("c:\project\image\winter.jpg")..

i use the asp.net C#.net...

plz reply for my question ,if any one know's ........

HttpPostedFile file = Request.Files["myFile"];
if (file != null && file.ContentLength )
{
    string fname = Path.GetFileName(file.FileName);
    file.SaveAs(Server.MapPath(Path.Combine("~/App_Data/", fname)));
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Hi you must use from httppostedfile and using system.io for path keyword

below code is upload without fileupload:

HttpPostedFile file = Request.Files["Filedata"];
if (file != null && file.ContentLength > 0)
{

string fname = Path.GetFileName(file.FileName);
file.SaveAs(Server.MapPath(Path.Combine("~/upload/", fname)));
}

I think you can use fileupload to select file and grab file content with FileUpload and getBytes method, so you must write a code for create file on server and write file with stream class and fill stream with filebytes result. the problem is get file path on client but i don't think any problem width save file on the server width this approch.

This question has already been answered. Start a new discussion instead.