ASP.NET file upload component in chrome

The file input type does not work in chrome and i think safari

when i try to upload a file only the filename AND NOT THE PATH is passed from the file upload component.

this is an issue because for the code to work it needs to know where the file is.

I am using the simplest method

        <asp:FileUpload ID="File1" runat="server" />

and
 string fn = System.IO.Path.GetFileName(File1.PostedFile.FileName);
            string SaveLocation = Server.MapPath("") + "\\" + File1.PostedFile.FileName;
            try
            {
                File1.PostedFile.SaveAs(SaveLocation);
                Response.Write("The file has been uploaded." + fn);
            }
            catch (Exception ex)
            {
                Response.Write("Error: " + ex.Message);
            }

which returns the actual filename and not the path

thanks in advance.
myshipAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajapandian_81Commented:
Due to security reasons of client machine, we can't read file path from program.

Anyhow file upload control can save the file in server. No need to know the client machine file path from program. Refer below link for simple explanation of file upload.

http://asp.net-tutorials.com/controls/file-upload-control/
0
sybeCommented:
That has nothing to do with the file upload component. It is a browser thing. Some browsers pass the complete file path, others don't. Building code that relies on the complete path of an uploaded file, is not going to work in all browsers.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

myshipAuthor Commented:
here is my issue.. i need to be able to select files and then use ftp

i am not using the saveas method
File1.PostedFile.SaveAs(SaveLocation);

so how can i do that?

0
sybeCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.