Retrive the value of fileupload control

Posted by Gokularts2006 under C# on 4/19/2012 | Points: 10 | Views : 2069 | Status : [Member] | Replies : 7
Hi

I upload the image file into sql server by using fileupload control.Now i need to update by front end.So far i want to select that file path in fileupload textbox.I need to use c# coding for this. any on3e kindly help me

Thanks

Gokulakrishnan


Responses

Posted by: Dotnetrajanikanth on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
The question is bit cloudy... Couldn't understand your requirement properly.. i will give the usual code that is used to save the file in a server folder...


'Finds the file type ie extension
string strFileType = System.IO.Path.GetExtension(this.Fileupload.FileName).ToString().ToLower();

//Save the file in a server folder
this.Fileupload.SaveAs(Server.MapPath("~/Uploaded/" + strFileName + strFileType));


____________
www.flickr.com/photos/psdesigner/

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsm_Gsv on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Not clear about the question..
How are you storing your image in database? Binary format/file path
There should be an ID(PK) for each image you upload, so while updating the whole_row/part_of_row, just replace the existing image

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gokularts2006 on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
Hi
i save the image as binary part only .In the sql i containing the three fields for upload

1 pathname
2 contanttype
3 Data

In the data filed image as saved as a binary part.

Now when i click the search button by using empid the image path need to select and display the fileulupload textbox.
Thanks

Gokulakrishnan

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsm_Gsv on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
you mean, you need to fetch the image path of your image from database and display in file upload textbox?

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gokularts2006 on: 4/19/2012 [Member] Starter | Points: 25

Up
0
Down
s i need fetch the filepath and need to dispaly in the file upload textbox again for edit the file.

thanks

Gokulakrishnan

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/19/2012 [Member] Bronze | Points: 25

Up
0
Down
http://www.codeproject.com/Tips/101834/How-to-Maintain-FileUpload-Control-s-State-after-P

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/19/2012 [Member] Bronze | Points: 25

Up
0
Down
http://www.nairaland.com/836601/c-capturing-file-name-fileupload

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response