?
Solved

FileUpload

Posted on 2008-10-24
2
Medium Priority
?
304 Views
Last Modified: 2013-12-17
I have some code which returns the file name which has been selected using the standard file uploader control. Here is the code;

Response.Write(FileUpload1.FileName + "<br>");

I need to be able to return the file location of the file which has been selected using the standard file uploader control. I am not sure how to do this.
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 2000 total points
ID: 22795916
Hi,

FileUpload1.PostedFile.FileName;

This would return a full path of the posted file. But for different browser the information send along will be different.

This should work perfectly for IE versions.

JINN

0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22796001
For firefox any another browser, the only way you can do it is using javascript to set the selected file location somewhere (in hiddenfield) and then refer to it when the server is posted back

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

In Page_Load
FileUpload1.Attributes.Add("onchange", "SetFileLocation()");

SetFileLocation is the javascript file where you take the location and set it in the hidden field

Hope this give you some idea

JINN
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question