INPUT TYPE ="FILE" PROBLEM...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mhonnphp
Forum Commoner
Posts: 37
Joined: Fri Oct 12, 2007 11:29 pm
Location: Philippines
Contact:

INPUT TYPE ="FILE" PROBLEM...

Post by mhonnphp »

Hello Everyone!

I've got a simple problem with regards of input type = "file".
What I want to do is to keep the value of the input type = "file"
but unlucky when the user clicked submit button the value of input type = "file" gone.

This code wont work on me...
<input type = "file" name = "txtfileName" value = "<?=$_Post['txtfileName']?>" />

Please Help thanks... and God Bless
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: INPUT TYPE ="FILE" PROBLEM...

Post by Christopher »

I cannot set that value for security reasons. If you could then you could build a page that specifies a file, auto submit the form and upload it. But, perhaps that is what you want to do. ;)
(#10850)
mhonnphp
Forum Commoner
Posts: 37
Joined: Fri Oct 12, 2007 11:29 pm
Location: Philippines
Contact:

Re: INPUT TYPE ="FILE" PROBLEM...

Post by mhonnphp »

arborint wrote:I cannot set that value for security reasons. If you could then you could build a page that specifies a file, auto submit the form and upload it. But, perhaps that is what you want to do. ;)
Thanks for the interest of helping me...
Anyway here is the scenario,

The user view my page then fill up the information ask..
Example
name : ("textbox")
address: ("textbox")
browse file : ("File")
then click submit

after clicking the submit button my program will verify the information. if information are incomplete it will prompt ("Please Complete the Information Needed!") and
back to the main page.

To make it more user friendly, all the fields that already fill up by the user are still there...
using <input type = "text" name = "txtName" value="<?=$_POST['txtName']?>" />
but this code is not working with <input type = "file" name = "txtFile" value="<?=$_POST['txtFile']?>" />

any suggestion?

Thanks
dayyanb
Forum Commoner
Posts: 46
Joined: Wed Jan 23, 2008 12:34 am

Re: INPUT TYPE ="FILE" PROBLEM...

Post by dayyanb »

There is no solution. This action is disabled for security reasons. They will have to reupload the file.
mhonnphp
Forum Commoner
Posts: 37
Joined: Fri Oct 12, 2007 11:29 pm
Location: Philippines
Contact:

Re: INPUT TYPE ="FILE" PROBLEM...

Post by mhonnphp »

dayyanb wrote:There is no solution. This action is disabled for security reasons. They will have to reupload the file.
ahh.... thanks for the information
Post Reply