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 ........

Recommended Answers

All 14 Replies

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

i will try majestic0110....!!!

thk u ... bye

let us know how it goes, remember to mark this thread as solved if this solves it!

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.

ya i upload the image from every visitor

hmmm isnt that AKA hacking lol

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)));
}

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.