Solved

File Uploads

Posted on 2003-10-30
4
266 Views
Last Modified: 2013-12-24
I am trying to put a File Upload box on a page and have it populated with an entry - "c:\test.txt". The user can then modify the entry. I tried the below code but nothing was in the box. What am I doing wrong?


<p><input type="file" name="F1" size="20" value="c:\test.txt"></p>
0
Comment
Question by:Neal Hartman
  • 2
4 Comments
 
LVL 31

Assisted Solution

by:seanpowell
seanpowell earned 300 total points
ID: 9653441
You can't preset the value in a File Upload control...

<p><input type="file" name="F1" size="20"></p>
0
 
LVL 23

Assisted Solution

by:adilkhan
adilkhan earned 200 total points
ID: 9667408
Thats a Security Issue.

Imagine you saved your passwords into a file c:\passwords.txt

and on my site i have a File upload Field and users will Push the button to upload files.
This way they can upload their Text Files(Holding passwords) without a notice and it is a Serious Security Issue.

if that was possible people could set the path as the form hidden field to(eg, c:\passwords.txt)  and get Values from hard Drive without a notice.

I hope you got the point.
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 300 total points
ID: 9668752
Yes - part of it's a security issue - part of it's user interaction. When the INPUT FILE type was first implemented, the problem with including the value attribute was that there was potential - for user's that needed to upload many files - of simply uploading the same file again and again (this is an inherent issue with the component, unless you move to an asp file upload component which allows for synchronous multiple file upload)

Coupled with the potential for abuse, it was determined that the ability to set a predetermined value for the file type would not be included as a user-agent component. As far as I know, every browser has adopted that model, and so there's no way to set it from the receiving site.
0
 
LVL 1

Author Comment

by:Neal Hartman
ID: 9670437
Got the idea, thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

947 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now