473,573 Members | 3,231 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

INPUT type=file problem

I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">

I'm passing the value of FileName as part of the Query String and assigning
it like so:

FileName = Request.QuerySt ring("FileName" )

It is definitely being passed/assigned correctly - I have this line for
debugging purposes:

Response.Append ToLog "FileName=" & FileName

which outputs the following in the webserver log file (abbreviated for
space):

GET /content/UploadDB.asp FileName=D:\Dat abase\ClassTool .mdb 200

The question is - why isn't the file name showing up in the INPUT box?

May 19 '06 #1
3 1594
Ron Hinds wrote:
I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">


Modern brwsers will not allow setting the value attribute of INPUT elements
of type "file", as it's a security hole that could be used by hackers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 19 '06 #2
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:ea******** ******@TK2MSFTN GP03.phx.gbl...
Ron Hinds wrote:
I have the following code on my ASP page:

<INPUT type=file name="FileUploa d" value="<%=FileN ame%>">
Modern brwsers will not allow setting the value attribute of INPUT

elements of type "file", as it's a security hole that could be used by hackers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Thanks - that, at least, explains it! I was just trying to provide
convenience for my end users but I guess they will have to "suffer" ;-)

May 19 '06 #3
"Ron Hinds" wrote ...
Thanks - that, at least, explains it! I was just trying to provide
convenience for my end users but I guess they will have to "suffer" ;-)


I faced the same problem a few years back - there is a way around it - but
not just by popping the value into the box...

Take a look at the SoftArtisans website (www.softartisans.com) - we use the
SA-FileUp product, and in one application in conjunction with XFile (another
of their products) - this will allow this to be done as it'll use their
component as opposed to the standard INPUT box...

Of course, this might all be more effort than you want make, I know it felt
that way for me - which is why I kept re-iterating to my boss that it
couldn't be done - alas - he didn't have any of it and we got the component.
In our scenario - we use it "blindly" - ie, we just pass the component a
file name and it simply takes it from the users PC and starts the upload
process (this is used on our corporate network as opposed to on a www
environment so a little naughty)...I seem to remember that there were
options for whether the process was hidden or not...

Regards

Rob
May 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3634
by: Oxygenearth | last post by:
Please who could help me with this... I had my structure in Win32, with Apache, PHP, and MySQL, I had a page in which I am transfering an image to the database in MySQL using PHP. But now I am in Apache/Linux/MySQL(FreeBSD) with the same files. My problem is.. when I try to submit the variables to the php file, this does not get the...
2
9911
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and replacing it with a button of my own background color and text. The file paths I'd like displayed in a textarea and then the files uploaded at once.
5
1611
by: Alon Zilkha | last post by:
Hi All, I just noticed a problem with Internet Explorer on Service Pack 2 of Windows XP and it is driving me insane!! I would greatly appreciate it if someone could help me out... I have a basic asp file (test.asp) with the following code: ---------------------------------------- <%
1
2069
by: Pavan Jha | last post by:
Hi, I am using File Input for one of my pages. I have multiple inputs on my page as <INPUT Type=FILE Name=File1> <INPUT Type=FILE Name=File2> and so on... I have a function for validating filetype which is called on onChange
2
2968
by: Quick Function | last post by:
For the <input type="file">, can I select directory? Multiple directories? Thanks, qq
15
4736
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
3
2817
by: Maris Janis Vasilevskis | last post by:
Hi, I create a binary file on client side using ActiveX. Now, I need to upload it. First idea - hidden Input type=file Does not work, because value is read only. A quickly made working solution: Visible input type=file
6
8094
by: reiyel | last post by:
hiya all i would like to ask some help for a little javascript, here's my problem: i have a html page with a <input type="file"> box, problem is i don't want the user to be able to write on the text field, he must use the browse button. i tried a lot of codes but no one works for both IE and firefox i tried to use onclick="blur",m but in that...
4
9065
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a...
8
2680
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a contact_us.php page.Now i can get all the inputs at the other end else the input(type/file) i donot want a submit button what i want that some how io...
0
7693
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8021
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7781
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5291
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2208
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1301
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1040
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.