Whenever I try to "Print" a Map or press the "Get Current Map Context" button I get this:

"The temporary directory of this site is not accessible"

I have verified (?q=admin/settings/file-system) and the path is properly set and chmoded (Drupal 6.9 + Mapping Kit 6.x-1.4)

Any ideas on what may be causing this? Thanks.

CommentFileSizeAuthor
#6 map2pdf.print_.inc_.patch375 bytesjpulles

Comments

jpulles’s picture

This message should be given when the folder for temporary files is not web accessible; e.g. when using /tmp on a linux system. What should work is using a path like 'sites/default/files/temp'.

The check is done at line 43 in file mappingkit.module by the check: file_exists('./' . file_directory_temp()). What are your settings for file_directory_path and file_directory_temp that this doesn't work?

Regards,
John

hvalentim’s picture

Thank you for your help. As it turned out the problem was that I had left the Temporary directory: with "/tmp" (assuming wrongly it seems this would be appended to the File system path and point to "sites/default/files/tmp").

Currently, I have placed "sites/default/files/temp" as Temporary directory and I no longer get the previous error. Still, now I face another issue: although the files are created fine (and are accessible trough FTP) when accessed by browser Drupal delivers a "The requested page could not be found" error while correctly pointing to for example "http://sitedomain.com/sites/default/files/temp/dmkugGQR7.pdf.

I mean: the files are created fine, the URL is correct but Drupal does not allow me to access them. Do I need to change the security settings somewhere?

Notes:
. I have "sites/default/files/temp" chmoded to 755
. The generated PDF, XML etc are chmoded to 600
. An .htaccess was automatically created within the "temp" dir with the following content:
"SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks"

hvalentim’s picture

An update on this: I have been trying with different browses and it definitely seems this has something to do with files generated being chmoded by default to "600"; if I I manually change them to "644" it will work (in Firefox oddly enough - perhaps due to some sort of cache issue - only if I change the URL by adding or removing "www").

So, if I am understanding this right, I would resume my "problem" as it is to this question: how can make I make Mapping kit chmod the files to "644" upon creation?

jpulles’s picture

At my aardbodem.nl site, the files are generated with chmod "600" so your setting shouldn't be a problem. If the file is correctly generated in the temp folder, the problem may be in the Apache configuration or the Drupal settings: url's to files in the temp folder should not be handled by Drupal.
I'm sorry I don't know how to reproduce your problem. Why are the files in the temp folder not reachable directly?

hvalentim’s picture

>url's to files in the temp folder should not be handled by Drupal.

Still, this is what is happening. I am getting a "The requested page could not be found." delivered by Drupal itself.

>Why are the files in the temp folder not reachable directly?

Well, it seems an Apache setting. I tried accessing the PDF "around" Drupal/the CMS (actually getting to the same path by using another domain/URL) and I got a "HTTP Error 403 - Forbidden"

In my linux shared hosting account, a file needs to be chmoded "644" in order to be accessible (most other files handled by Drupal seem to be chmoded that way).

jpulles’s picture

StatusFileSize
new375 bytes

The attached patch chmod's the generated pdf to 644. Does that help you?

hvalentim’s picture

Indeed. That fixed it for the "Print to PDF" part. Thanks a bunch!

Due to the same permissions issue, I am still unable to access the generated context XML file tough :)

jpulles’s picture

When the new 6.x-1.x-dev is released, you can enter 0644 in the chmod field of the general mapping kit settings. This should solve your problem, otherwise please let me know what your system returns as PHP_OS. The fix is only for Linux/Unix systems.

Regards,
John

jpulles’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.