Jump to content

Trying to unpack tar files....


NoDoze

Recommended Posts

But it keeps failing...

 

This is what I have:

if (!chdir ("/home/user/public_html/folder/{$_POST['user_id']}"));
{
echo "failed to change directories...";
exit;

if (!system("tar -zxvf files.tar")) 
{
echo "failed to unpack files.tar";
exit;
}
}

 

I think it's a permissions thing....But I'm not sure how to chmod that either...

if (!chown ("/home/user/public_html/folder/{$_POST['user_id']}", nobody));
{
echo "failed to change file owner...";
exit;
}

 

Cause it's all via php, the file.tar is being copied with apache permissions, when the rest of the files in the destination folder are nobody permissions... I dunno if that would make any difference or explain why it's not unpacking them...?

 

Thanks for the help!

 

 

Link to comment
https://forums.phpfreaks.com/topic/119757-trying-to-unpack-tar-files/
Share on other sites

*sigh*

 

I even tried adding:

 

chmod ("/home/user/public_html/folder/{$_POST['user_id']}/file.tar", 0777);
chown ("/home/user/public_html/folder/{$_POST['user_id']}/file.tar", "nobody");
chdir ("/home/user/public_html/folder/{$_POST['user_id']}");

 

before the unpacking...

 

But it didn't work :(

 

Please help.

 

Thanks!

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.