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.

Recommended Answers

All 2 Replies

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

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

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

Thanks.

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.