-1

In my project I need to open file dialog so that user can select local image file on his machine.

I need to access that local file and rename it and FTP that file on server.

What is the best way to that?

I have already used FileUpload control but some thread exception was occurring I don't rember it now sorry.

Any suggestions will be welcomed.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Nitin Daphale
0

In my project I need to open file dialog so that user can select local image file on his machine.

I need to access that local file and rename it and FTP that file on server.

What is the best way to that?

I have already used FileUpload control but some thread exception was occurring I don't rember it now sorry.

Any suggestions will be welcomed.

Try Fileuploader control, for help see the following links
http://www.codeproject.com/KB/aspnet/fileupload.aspx

http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/ctrlref/standard/FileUpload/FileUpload1.src
Mark as solved if it helps you!!!

Edited by reach_yousuf: n/a

0
fileNameOnServer = Path.GetFileNameWithoutExtension(FileUpLoad1.FileName) + random.Next() + Path.GetExtension(FileUpLoad1.FileName);

FileUpLoad1.SaveAs(HttpRuntime.AppDomainAppPath + "images/logos/" +fileNameOnServer);

Thanks.

Edited by __avd: Correct code tags.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.