Jump to content

[SOLVED] [PERL] Permissions and saving a file


Recommended Posts

Hello Everyone,

I have a upload progress indicator that is a combination of AJAX, Perl, and PHP. Since PHP cannot read how much of a file has been currently uploaded, yet PERL can, it is where I had to look at.

 

When I upload the file, PERL saves the POST data in a temporary file, to which passes the filename to a PHP script and the PHP script moves the temporary file to a permanent file where I want it to be.

 

This works fine, except for one problem. It turns out that when PERL saves a file that doesn't exist, it sets the permissions to 0600. This basically means that only the PERL module can read and write to the file.

 

For some reason as well, I cannot set the permissions on the temporary file.

 

I tried

 

#... Snip file saving code
chmod 0755, 'temp_file.html';

 

But still when php moves the file it still has the same 0600 permissions.

 

Does anyone have any tips for saving files and permissions that exist with perl itself, or how to get them to carry over?

 

The funny thing is is that PHP can move the file, it just cannot read/write/execute it. Weird huh?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.