I am working on a Drupal 7 project, the requirement is to upload a HTML file to server and pass the HTML file as a parameter to a Perl script and capture the return code given by the Perl program. the weird pro开发者_JAVA技巧blem is, if I FTP the HTML file into the server, it works fine. but if I upload using Drupal file upload its getting saved in /tmp but not able to run it using Perl. the permissions are the same, but still Perl is not able to access the file, did anyone ran into this problem?
Sirish
You need to consider the user you are uploading via FTP, the user Perl is when it executes the file, and the user Drupal runs as.
You mentioned permissions are the same, but is ownership the same too?
Usually drupal will upload files as the apache user (apache, www-data, or whatever user apache is setup to run as). If Perl is running as a different user, then the permissions on the uploaded file will need to be set so that the Perl user can execute the apache owned file.
If that is the case and the Perl script needs to execute that file, then you can use PHP chmod function after the upload to set the file as executable (maybe 755).
精彩评论