Gossamer Forum
Home : General : Perl Programming :

Upload image question ! Why file was chmoded 600 instead 644

Quote Reply
Upload image question ! Why file was chmoded 600 instead 644
Hello !

My upload image script was working fine before. I've changed nothing on the script. But today I found out the image which was uploaded onto my web server can't show up on browser because it was chmoded 600-

You think the problem comes from web server? If so, how to tell my hosting company to fix it (in case they don't believe their server went wrong)?.

The script can upload file on the web server but how come the file was chmoded 600 automatically instead 644.

Hope you can help me out!

Thanks

N.A
Quote Reply
Re: [newage24] Upload image question ! Why file was chmoded 600 instead 644 In reply to
You might want to consider adding a system call to update the file perm to 644 after the file is uploaded.

Example:

chmod 0644, $filename.$file_ext;

Of course, this is a generic example.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [newage24] Upload image question ! Why file was chmoded 600 instead 644 In reply to
Try adding;

chmod(0666, $file);

I'm not definate of the format, as I havn't used it in a Perl script for a little while Tongue

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Upload image question ! Why file was chmoded 600 instead 644 In reply to
Andy,

Why are you recommending changing the file perm to read/write globally. That, IMO, is a bad idea.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Andy] Upload image question ! Why file was chmoded 600 instead 644 In reply to
You should use 644 as Eliot mentioned otherwise you are opening up global reading/writing