You are here: PHP and upload « PHP Programming Language « IT news, forums, messages
PHP and upload

Posted by Jψrn Dahl-Stamnes on 01/30/07 14:10

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.
If I upload it to a different web-server running RH 7.3 (an internal
test-webserver), it works OK.

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.

The HTML code for the form is:
<FORM ENCTYPE=multipart/form-data ACTION=upload.php METHOD=post><PRE>
<INPUT TYPE=hidden NAME=max_file_size VALUE=4096000>
Title: <INPUT TYPE=text SIZE=24 NAME=title> File: <INPUT TYPE=file
NAME=upfile>
<BR><INPUT TYPE=submit VALUE="Load"></PRE></FORM>

When I look at the access_log file at the web-server, the PHP script in the
ACTION field in the FORM is not called. So the error happens before the
script is called.

I have on question about the upload script: Where is the content of
$_FILES['upfile']['type'] set? I assume it is the web-server that sets this
before calling the action script?
Could the cause of the error be that the web-server is not able to determin
the type of the file?

I have tried with other PDF documents, also created from MS Word and
converted to PDF using OpenOffice 2.0. And it workes OK. So it seems like
there is somehting in the file that cause the problems.

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

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация