Re: two confuse problems

From: Date: Wed, 08 Aug 2007 16:13:17 +0000
Subject: Re: two confuse problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-260442@lists.php.net to get a copy of this message
EVEL_LIU@WISTRON.COM wrote:
1,Click the brows bottom, and select one file, return the file name to the text area and the file¡¦s size to the $filesize. I don¡¦t how to make the browser bottom to achieve that.?
PHP can't help you with that. When a person selects a file in a file upload form widget, everything is taking place on the client side. Additionally, file upload widgets have restrictions with regard to Javascript for security reasons. And the size of the selected file cannot be known until it is uploaded to the server. You can see it in $_FILES['your_form_field_name']['size']. See the manual page for uploads: http://www.php.net/manual/en/features.file-upload.php
2,use the zip_read function of the PHP: ¡]because most of the file type is *.zip and *.doc¡^ ... Warning: zip_read() expects parameter 1 to be resource, integer given in D:\www¡Kon line 6
Check the manual: http://www.php.net/zip_open --snip-- Return Values Returns a resource handle for later use with zip_read() and zip_close() or returns the number of error if filename does not exist or in case of other error. --snip-- So, zip_open() is not opening the file and is returning an error code. See the comment by "saulius at solmetra dot lt" on that page for instructions for dealing with errors. brian

« previous php.general (#260442) next »