PHP Classes

Validation problem with test_upload_progress

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Locating addresses on...  >  All threads  >  Validation problem with...  >  (Un) Subscribe thread alerts  
Subject:Validation problem with...
Summary:It sends a validation error always
Messages:9
Author:manu fer
Date:2008-05-06 22:49:39
Update:2008-05-08 19:32:04
 

  1. Validation problem with...   Reply   Report abuse  
Picture of manu fer manu fer - 2008-05-06 22:49:40
I have a problem, when i try to upload any file(any kind: txt, doc, exe, mp3, anthing) i open test_upload_progress.php on firefox and I select the file to upload, and after a few senconds it says: It was not specified a valid file to upload.

It doesen't matters the file type it always show that error!!

The files i try to upload does EXISTS I checked it at first.

By the way, my hosting support team told me that they have php 4.4.7 installed on their servers.


Thanks on advance. Manuel Fernández.

PD: Sorry but my english, but my first language is spanish. :S

  2. Re: Validation problem with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-07 06:20:45 - In reply to message 1 from manu fer
For uploaded files ValidateAsNotEmpty checks the size of the uploaded file set in the $_FILES array. If it is zero, the file field is considered invalid. Make sure you are not uploading empty files.

  3. Re: Validation problem with...   Reply   Report abuse  
Picture of manu fer manu fer - 2008-05-07 14:39:29 - In reply to message 1 from manu fer
Unfortunately I'm uploading non empty files, perhaps some of them are small (like 20 kb) but they are not empty!!

And the error message is shown anyway.

I don't know if I have installed your classes correctly.
I just uploaded'em on the same dir where I uploaded the Test_Upload_progress.php

I don't know if i have to set up an upload dir, and how to do so if needed.

Also, i've uploaded the following files, perhaps i missed some needed file, please tell me.

form_ajax_submit.php
form_frame.html.php
form_upload_body.html.php
form_upload_progress.php
forms.php
message.html.php
test_upload_progress.php

Thanks on advance.

  4. Re: Validation problem with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-07 21:51:02 - In reply to message 3 from manu fer
The class checks the $_FILES super-global variable, so the problem should not be with the forms class. You may want to add var_dump($_FILES); to see if PHP is receiveing the files correctly.

  5. Re: Validation problem with...   Reply   Report abuse  
Picture of manu fer manu fer - 2008-05-07 22:30:53 - In reply to message 4 from Manuel Lemos
I don't know what happend now, but it's partially working.
I mean, it uploads the files but it doesn't show the progressbar and that stuff.

I've checked an answer from other way who had this problem and tried to do what you suggested him to do.

You said that perhaps gzip was compressing ajax responses so i asked my hosting technical assistants to add this line in the .htaccess: mod_gzip_item_exclude rspheader "X-do-not-compress-this: yes"

But I'm not sure qhere should add this code: Header('X-do-not-compress-this: yes');


I changed the form_upload.php definition: var $response_header=''; to var $response_header='X-do-not-compress-this: yes';

But it appears that it's not working since i still cannot see the progressbar :S


Thanks in advance.

  6. Re: Validation problem with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-07 23:48:58 - In reply to message 5 from manu fer
That would be a problem only if your system already fulfilled all the requirements to have the upload progress working. The requirements are:

1. You are running PHP 5.2 or an older PHP version with the upload progress hooks patch installed.

2. You have the upload progress extension installed

Take a look at phpinfo() output and see what PHP version is used and check if the uploadprogress extension is available.

  7. Re: Validation problem with...   Reply   Report abuse  
Picture of manu fer manu fer - 2008-05-08 04:21:57 - In reply to message 6 from Manuel Lemos
I'm running PHP 4.4.7 on Apache 1.3.37 (LINUX)

The only thing i have done is putting the following files on a folder and tried to run test_upload_process.php

form_ajax_submit.php
form_frame.html.php
form_upload_body.html.php
form_upload_progress.php
forms.php
message.html.php
test_upload_progress.php

the url to the phpinfo of the server is:

andrea.manusoftar.com.ar/info.php

sorry for asking you yo see it but i don't know exactly what to look for :S

and the test file url is
andrea.manusoftar.com.ar/test_uploa ...


By the way, i've seen an extension for the upload progress (http://pecl.php.net/package/uploadprogress) but it says that it only supports PHP 5.2.x


I'm sorry cause im buthering you, and i'm very happy you are giving me a hand.

PD: i've also uploaded the upload.gif (or something like that)


Basicly, the question is..: Am I supossed to do something else that uploading those files i liste into one directory of my site in order to use the progress upload? (i've uploaded some templates required too)



Thanks in advance. Manuel Fernández.

  8. Re: Validation problem with...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-05-08 04:43:54 - In reply to message 7 from manu fer
The upload progress extension works in PHP versions before PHP 5.2 but you need to apply a patch and recompile and install PHP again. I doubt you did that. That is why it does not work for you.

Even if you have PHP 5.2 or later, you would need to have the upload progress extension installed. Since it does not come with the regular PHP distribution, you would also have to install that.

Therefore I think you need assistance to from your hosting system administration to install an appropriate PHP setup.

  9. Re: Validation problem with...   Reply   Report abuse  
Picture of manu fer manu fer - 2008-05-08 19:32:04 - In reply to message 8 from Manuel Lemos
Fine, I think it would not be possible to recompile php cause i'm not the only one who uses the hosting, so they would not take that much work only for me.

Anyway I want to thank you for all the time you gave me.


Anything i could do for you, i mean, any programing stuff, just tell me, i will be happy to help, like you helped me.


Thank you very very much.

And good luck!!!.


Manuel Fernández.