pdf fclose error

See all posts Reply

pdf fclose error new!
by javier, 16 years, 11 months ago
hi im uploading to a 777 folder a pdf (images go ok) and show this error
PHP error debug
  Error: fclose(): supplied argument is not a valid stream resource	 
  Error type/ Nr.: Warning - 2
  File: ~/class.upload.php
  Line: 2061
  Line 2061 source: @fclose($f);
 
Parser timing
  MySQL: 0,0130 s (32 Requests)
  PHP: 0,0764 s
  Total: 0,0894 s
Reply
Re: pdf fclose error new!
by colin, 16 years, 11 months ago
Can you print out $foo->log just before the line 2061?
print_r($this->log,1) ;
@fclose($f);

Maybe there is a logic problem in the code... I can't see where at the moment.

Also, do you have open_basedir restrictions in place?Reply
Re: pdf fclose error new!
by javier, 16 years, 11 months ago
this show me
source is an uploaded file
- upload OK
- file name OK
- source variables
    file_src_name : aa.pdf
    file_src_name_body : aa
    file_src_name_ext : pdf
    file_src_pathname : ------/pymr
    file_src_mime : application/force-download
    file_src_size : 2010 (max= 2097152)
    file_src_error : 0
process file to ----------------/resources/31/
- file size OK
Reply
Re: pdf fclose error new!
by javier, 16 years, 11 months ago
if i use
$MyObject->mime_check = false;
it worksReply
Re: pdf fclose error new!
by colin, 16 years, 11 months ago
Basically, the MIME type of your PDF file is not recognized by the class, or by the underlying system.

application/force-download is a weird MIME type. It should be application/pdf for a PDF document.

It is possible that your server is wrongly set up, and misintepret the MIME types. If you have the mime_magic extension enabled with PHP, check its configuration.

Maybe this page can help.Reply