Forums / Setup & design / Not able to download pdf files from Media

Not able to download pdf files from Media

Author Message

Iain MacLean

Monday 26 January 2004 5:04:39 pm

Hi

I'm having trouble getting ezpublish-3.3-2 to find PDF files after I upload them into the Media folder or a file library section I have created in the Content area. I can upload MSOffice and OpenOffice docs and spreadsheets OK, and they can be downloaded, but I can't download PDF files. A link to a pdf file appears in the correct node (with the correct file name, but 0kb as the size) and there is a copy of the file in /var/site_dirctory/storage/original/text.

However, when I try to download it, it get an "Object is unavailable" error.

I have checked the permissions on the folders and they are OK (as I can upload, I guess that's obvious).

If I re-name a pdf and give it a *.doc or *.sxw extension before uploading it, everything works properly.

I had the same problem with eZpublish-3.3-1.

I had thought it might be an Apache mime handling problem. I inserted a new AddType application/pdf in the httpd.conf, but that didn't work, either.

I'm guessing it's got something to do with eZpublish not recording the new file name of the pdf in the /var directory so that it can retrieve it later, but I have no idea where to start if that is the case.

It's got me stumped!

Anyone have any bright ideas?

Iain MacLean

Iain MacLean

Thursday 29 January 2004 12:11:48 am

Still don't have a solution to this, although it appears that eZpublish is interpreting the mime type application/pdf as text/pdf, which is why it stores PDF files in /var/site_directory/storage/original/text instead of /var/site_directory/storage/original/application. If I copy the newly uploaded PDF into /var/site_directory/storage/original/application, then I can download it. Postscript files are correctly stored in /var/site_directory/storage/original/application, and text files are stored in /var/site_directory/storage/original/text. I can download both from their respective directories.

It seems that the files ezbinaryfiletype.php and ezmimetype.php are the ones that control this process, especially the functions in ezmimetype.php, possibly using the array var $QuickMIMETypes = array() at the bottom of ezmimetype.php. However, that doesn't explain why PDF files end up interpreted as text/pdf rather than application/pdf.

Direct download PDF export works OK, although if I don't export for direct download I get a error "You don't have permission to access /var/site_directory/storage/pdf/file.pdf on this server". The newly-created PDF file is stored in /var/site_directory/storage/pdf (as it is supposed to be), and apache has all the required permissions, but I still can't download it.

I do not have pstotext installed on my server or development machine (both Linux), but I do have pdftotext installed. Could that be a possible cause?

The file library is an important part of my client's site, so I would be really, really grateful of any suggestions as to the possible cause of the problem.

Iain

Iain MacLean

Saturday 31 January 2004 6:44:42 pm

Problem sorted. It seems to be caused by the way Opera handles the mime type of PDF files. When I tried uploading PDF files with another browser it worked fine. Both Firebird and IE6 put the PDF file in the correct directory for download. Should have tried this earlier :-(.

I've seen some posts about how Netscape handles PDF files when downloading. Perhaps this is relelated?

Cheers

Iain

eZ debug

Timing: Jan 19 2025 07:01:35
Script start
Timing: Jan 19 2025 07:01:35
Module start 'content'
Timing: Jan 19 2025 07:01:36
Module end 'content'
Timing: Jan 19 2025 07:01:37
Script end

Main resources:

Total runtime1.8864 sec
Peak memory usage4,096.0000 KB
Database Queries192

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 590.5313180.8125
Module start 'content' 0.00571.5542 771.3438441.8750
Module end 'content' 1.55990.3264 1,213.2188333.4688
Script end 1.8863  1,546.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.2121210.0002
Check MTime0.00150.0781210.0001
Mysql Total
Database connection0.00090.049510.0009
Mysqli_queries1.751492.84411920.0091
Looping result0.00230.12021900.0000
Template Total1.855598.420.9277
Template load0.00190.098920.0009
Template processing1.853698.259520.9268
Template load and register function0.00020.012110.0002
states
state_id_array0.00100.050710.0010
state_identifier_array0.00210.112020.0011
Override
Cache load0.00160.0831260.0001
Sytem overhead
Fetch class attribute can translate value0.00220.118220.0011
Fetch class attribute name0.00140.072630.0005
XML
Image XML parsing0.00120.061320.0006
class_abstraction
Instantiating content class attribute0.00000.000430.0000
General
dbfile0.04072.1562210.0019
String conversion0.00000.000230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 4

Time used to render debug report: 0.0002 secs