Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Input File default value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Input File default value

 Post Reply Post Reply Page  123>
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: Input File default value
    Posted: 16 November 2003 at 9:01am

Can I assign a default value for an Input of type File:
this is the code: <input type="file" name=attach1 size="20">

the default value is a QueryString.

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2003 at 9:03am

i added the value but didn't work!!
<input type="file" name=attach1 Value="<%= Request.QueryString("ImageFile") %>" size="20">

I made a script like this but didn't work too with the Input File!!


<input type="text" name=attachtext Value="<%= Request.QueryString("ImageFile") %>" size="20">


<input type="text" name=attachtext Value="" size="20"
onfocus="value=document.Form.attachtext.value">

didn't work too, is there a way?



Edited by zMaestro
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2003 at 9:41am

You can't set the value of a file field, for security reasons.

If it wasnt like that you could just use document.Form.attachtext.value

Then

document.Form.Submit()

to nick files off their pc.

 

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2003 at 2:51pm

I want to upload a file to the server, and write its name in the database, i want to make it in one step, but I'm using an asp code that doesn't accept the Request.Form and uploading in the same time, I must use Request.QueryString, something about binary or so.

I made a file where the user browse for the image he wants to upload from his HDD, and when click on submit the file name enters the database, and then redirected to the page where he can upload the image. I don't want him to rechose the image again, just be uploaded automatically.

I tried to use a normal <Input text> but didn't work, must be of type <Input file>.

did I make it more clear now? or you are confused?

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 16 November 2003 at 3:49pm

doesnt uploading a file stop you from using the Request.Form and you have to use "component.form" (component being the upload component eg ASPUpload.... well the "object name" anyway)

Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2003 at 2:23am

sure, that is why in the uploading page I am using Request.QueryString instead of Request.Form

I've ASPupload installed on my server but I don't know .. I think pure asp is simpler

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2003 at 6:31am
Originally posted by zMaestro zMaestro wrote:


I've ASPupload installed on my server but I don't know .. I think pure asp is simpler

thats quite a statement to make considering you can't get "pure asp" to work.... if you use ASPupload, you could have "normal" form fields on there and access them by  uploadform.form("This Other Field")

Contribute to the working anarchy we fondly call the Internet
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2003 at 2:14pm
www.aspupload.com and go to the Reference area, it helps you alot, ive used it alot
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.