[PHP] input type=file problem (Maybe 0T)
Hey, Heres what I am doing, I have a form where a user can enter values and in the form I have a FILE box so the user can upload her pic, if she screws up anywhere (eg: putting an alphabet in her date of birth) I send her back to the form and her date of birth gets highlighted plus the value she entered comes in the date of birth and also an error explanation underneithso far so good. The problem is, if she has tried to upload a pic at the same time and screwed up on the date of birth I am unable to send back the value of the FILE box so that too get populated... I tried setting a VALUE=path/file but that does not work. What am I missing here? Thanks, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] input type=file problem (Maybe 0T)
Ryan A wrote: Hey, Heres what I am doing, I have a form where a user can enter values and in the form I have a FILE box so the user can upload her pic, if she screws up anywhere (eg: putting an alphabet in her date of birth) I send her back to the form and her date of birth gets highlighted plus the value she entered comes in the date of birth and also an error explanation underneithso far so good. The problem is, if she has tried to upload a pic at the same time and screwed up on the date of birth I am unable to send back the value of the FILE box so that too get populated... I tried setting a VALUE=path/file but that does not work. What am I missing here? Thanks, Ryan As far as I know, you can't set the initial values for 'file' inputs. It's a security thing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] input type=file problem (Maybe 0T)
clip setting a VALUE=path/file but that does not work. /clip As far as I know, you can't set the initial values for 'file' inputs. It's a security thing. H, you're right,saw the same thing on google after digging a little deeper, thanks mate. Cheers, Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] input type=file name=txt_file /
Everything you need is here: http://www.php.net/manual/en/features.file-upload.php#features.file-upload.post-method John Taylor-Johnston wrote: Instead of using fread, I want to upload a *.txt file using: input type=file name=txt_file / and display it in a textarea. Where do I go now? Specifically, how do I get $contents? Thanks, John ?php $filename = /usr/local/something.txt; $handle = fopen ($filename, r); $contents = fread ($handle, filesize ($filename)); fclose ($handle); if ($contents){echoformtextarea$contents/textarea/form;} else{echo no contents there;} ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] input type=file name=txt_file /
Instead of using fread, I want to upload a *.txt file using: input type=file name=txt_file / and display it in a textarea. Where do I go now? Specifically, how do I get $contents? Thanks, John ?php $filename = /usr/local/something.txt; $handle = fopen ($filename, r); $contents = fread ($handle, filesize ($filename)); fclose ($handle); if ($contents){echoformtextarea$contents/textarea/form;} else{echo no contents there;} ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] INPUT type=file value=????
I realize that this isn't a PHP issue, but I'd like find out they why's/wherefore's of this: The W3C HTM 4x spec(s) say that when using the file type on a form input element, User agents may use the value of the value attribute as the initial file name. I can't get Mozilla, Netscape, nor IE to do this. Here's my code: FORM ENCTYPE=multipart/form-data ACTION=?=$PHP_SELF? METHOD=POST Attachment #1: INPUT NAME=s_attachment TYPE=file VALUE=d:\\test.txt INPUT TYPE=submit VALUE=Send File /FORM The wrapped lines do have a space in front of them. Is this an oversight, did I miss something in the docs, or have I done something really stupid? -Al -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] input type=file
this doesn't relate directly to PHP, but it will when I am done. How can I create a file input that reads from a directory on the server instead of the users machine Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] input type=file
to put it simply, you can't... but you could put an input type of text with a link or a button next to it manually, and then on the onClick of either this button or link open a secondary window running a PHP script that reads a particular directory structure with full navigation support. Then when the user clicks a filename, place that into the input in the first window and close the secondary window. However, this would require JavaScript and a full recursive directory browser script in PHP. I have something similiar to this in a content manager script I've written, but it doesn't check other directories. It picks an image from an /ImageLibrary/ directory, allowing the user to preview an image, upload new images, delete images, rename images, but most importantly pick a filename. Then it populates a field in the content manager screen for saving to a database. Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com = -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:57 PM To: [EMAIL PROTECTED] Subject: [PHP] input type=file this doesn't relate directly to PHP, but it will when I am done. How can I create a file input that reads from a directory on the server instead of the users machine Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] input type=file
that should be contents of, not contents or... Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:16 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] input type=file so then maybe, if I understand it correctly (which may or may not be true) I could read the contents or a directory and populate a dropdown list...? Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -Original Message- From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:16 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] input type=file to put it simply, you can't... but you could put an input type of text with a link or a button next to it manually, and then on the onClick of either this button or link open a secondary window running a PHP script that reads a particular directory structure with full navigation support. Then when the user clicks a filename, place that into the input in the first window and close the secondary window. However, this would require JavaScript and a full recursive directory browser script in PHP. I have something similiar to this in a content manager script I've written, but it doesn't check other directories. It picks an image from an /ImageLibrary/ directory, allowing the user to preview an image, upload new images, delete images, rename images, but most importantly pick a filename. Then it populates a field in the content manager screen for saving to a database. Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com = -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:57 PM To: [EMAIL PROTECTED] Subject: [PHP] input type=file this doesn't relate directly to PHP, but it will when I am done. How can I create a file input that reads from a directory on the server instead of the users machine Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] input type=file
that would be one option... however, if you're going to let them navigate through different directories, it would be a bit tougher in a dropdown... but if all you need is to display a list of files to them, then that would work great Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com = -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 5:16 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] input type=file so then maybe, if I understand it correctly (which may or may not be true) I could read the contents or a directory and populate a dropdown list...? Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -Original Message- From: Joe Sheble (Wizaerd) [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:16 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] input type=file to put it simply, you can't... but you could put an input type of text with a link or a button next to it manually, and then on the onClick of either this button or link open a secondary window running a PHP script that reads a particular directory structure with full navigation support. Then when the user clicks a filename, place that into the input in the first window and close the secondary window. However, this would require JavaScript and a full recursive directory browser script in PHP. I have something similiar to this in a content manager script I've written, but it doesn't check other directories. It picks an image from an /ImageLibrary/ directory, allowing the user to preview an image, upload new images, delete images, rename images, but most importantly pick a filename. Then it populates a field in the content manager screen for saving to a database. Joseph E. Sheble a.k.a. Wizaerd Wizaerd's Realm Canvas, 3D, Graphics, ColdFusion, PHP, and mySQL http://www.wizaerd.com = -Original Message- From: Jerry Lake [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:57 PM To: [EMAIL PROTECTED] Subject: [PHP] input type=file this doesn't relate directly to PHP, but it will when I am done. How can I create a file input that reads from a directory on the server instead of the users machine Jerry Lake- [EMAIL PROTECTED] Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]