954,148 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Upload image without using fileupload

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

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

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

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 
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>>>>>

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

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

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

i will try majestic0110....!!!

thk u ... bye

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

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

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

sorry majestic0110......

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

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

You may use: File Field (Html control) - to locate image file from your system and upload to your database. I found an example at http://www.programmingknowledge.com/ImageUpload.aspx

postmaster
Newbie Poster
19 posts since May 2006
Reputation Points: 10
Solved Threads: 1
 

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.

plazmo
Posting Whiz in Training
207 posts since Aug 2005
Reputation Points: 23
Solved Threads: 16
 

ya i upload the image from every visitor

dskumar_85
Junior Poster in Training
69 posts since Mar 2008
Reputation Points: 9
Solved Threads: 1
 

hmmm isnt that AKA hacking lol

majestic0110
Nearly a Posting Virtuoso
1,328 posts since Oct 2007
Reputation Points: 256
Solved Threads: 72
 

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

Harmeet Anand
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

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

yeganehaym
Newbie Poster
2 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

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

yeganehaym
Newbie Poster
2 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You