473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

INPUT type=file problem

I have the following code on my ASP page:

<INPUT type=file name="FileUpload" value="<%=FileName%>">

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

FileName = Request.QueryString("FileName")

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

Response.AppendToLog "FileName=" & FileName

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

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

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

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

<INPUT type=file name="FileUpload" value="<%=FileName%>">


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******@NOyahoo.SPAMcom> wrote in message
news:ea**************@TK2MSFTNGP03.phx.gbl...
Ron Hinds wrote:
I have the following code on my ASP page:

<INPUT type=file name="FileUpload" value="<%=FileName%>">
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
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...
2
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...
5
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...
1
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...
2
by: Quick Function | last post by:
For the <input type="file">, can I select directory? Multiple directories? Thanks, qq
15
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...
3
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...
6
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...
4
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...
8
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.