Re: PHP and upload



Erwin Moller wrote:

Jørn Dahl-Stamnes wrote:

Hi,

I have a strange problem when uploading a PDF document to a web-server.
When I try this to a web-server running Apache 2 on a FC 4, it fails.
Firefox says that the document contain no data.

That means nothing.
You should check what PHP is doing. Clearly you have some problem handling
uploaded files.
A blind guess would be a permissionproblem, but you should debug this
yourself.

I can upload all kinds of documents, images, excel sheets etc. But not this
particular file. I cannot see what PHP is doing, since the upload script is
never called before the error occurs.

If I upload it to a different web-server running RH 7.3 (an internal
test-webserver), it works OK.

Probably the relevant directories on the testserver are open for PHP to
write in, and not on your FC4 machine.

No, I have checked this. I am able to upload other files without problems.

The PDF document is created by OpenOffice 2.0 from a MS Word document. I
have also had it converted to PDF in MS Word that could create PDF
documents. Still the same error. I am able to view the PDF document on a
Windows machine, but not on my FC 4. Ghostscript crash.

This is not relevant.
A file is a file, even if you upload it.

That is what I think to. But why does it complain on this one file, while
all other files is uploaded without any problems at all? I have tried 20
different files (JPEG, MS Words, Excel, other PDF files) with success.

If things are programmed OK, the content or origin of the file matters
not.

Since I am able to upload 20 other files, the code IS working.

* I have checked the php.ini files, and it seems to be OK.
* The upload directory is writeable since I can upload other files.
* print_r ($_FILES) will not work, since the action script is never called
when the error occurs.

Good luck.

thanks... I'll need it since there is no good answer why this happens.

--
Jørn Dahl-Stamnes
http://www.dahl-stamnes.net/dahls/
.


Quantcast