Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old May 19th, 2006, 09:15 PM
Ron Hinds
Guest
 
Posts: n/a
Default 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?



  #2  
Old May 19th, 2006, 09:15 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: INPUT type=file problem

Ron Hinds wrote:[color=blue]
> I have the following code on my ASP page:
>
> <INPUT type=file name="FileUpload" value="<%=FileName%>">[/color]

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"


  #3  
Old May 19th, 2006, 09:25 PM
Ron Hinds
Guest
 
Posts: n/a
Default Re: INPUT type=file problem

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eaHQjB4eGHA.3640@TK2MSFTNGP03.phx.gbl...[color=blue]
> Ron Hinds wrote:[color=green]
> > I have the following code on my ASP page:
> >
> > <INPUT type=file name="FileUpload" value="<%=FileName%>">[/color]
>
> Modern brwsers will not allow setting the value attribute of INPUT[/color]
elements[color=blue]
> 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"[/color]

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" ;-)



  #4  
Old May 20th, 2006, 11:15 AM
Rob Meade
Guest
 
Posts: n/a
Default Re: INPUT type=file problem

"Ron Hinds" wrote ...
[color=blue]
> 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" ;-)[/color]

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.