|
Posted by Jefferis NoSpamme on 07/04/06 23:28
On 7/4/06 2:21 AM, in article 6Onqg.13834$XK2.11624@reader1.news.jippii.net,
"Kimmo Laine" <spam@outolempi.net> wrote:
> Assuming your file field looks something like this:
> <input type="file" name="myfile">
> The error code is, like I explained the first time, in the $_FILES array
> under $_FILES['myfile']['error'].
>
> if( $_FILES['myfile']['error']==UPLOAD_ERR_FORM_SIZE ){
> echo "too big file";
> }
Thank you again Kimmo. I got it to work finally. The problem I believe is
that I was trying to use filesize($myfile) and other functions which have
to do with a file that is already uploaded to the server. When I tried to
use filesize() to the file, the error came back " no such file."
When I tried to apply your code straight, it failed on the server error:
case UPLOAD_ERR_NO_TMP_DIR:
case UPLOAD_ERR_CANT_WRITE:
echo "File {$_FILES['liite']['name']} upload failed because of
server error. Please contact administration.";
I assume the problem is that I have not given permissions for a file upload
to reside on the server, as that was not my goal. I'm not entirely sure how
this pass through function works with email, but I believe it is only a
temporary directory, and it is handled automatically by my server. So I
could not check file sizes with a lot of the functions in the uploading a
file section of php manual. It has to be done on the fly, so to speak, and
yes your code:
> if( $_FILES['myfile']['error']==UPLOAD_ERR_FORM_SIZE ){
>> echo "too big file";
>> }
Worked perfectly. Thanks again,
Jeff
~~~~~~~~~~~~
Jefferis Peterson, Pres.
Web Design and Marketing
http://www.PetersonSales.com
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
[Back to original message]
|