vinnieza Posted May 31, 2006 Share Posted May 31, 2006 I get "There was an error executing this query. Please try later." when trying to use the search :(Anyway, what i want to do is extract an xml file from a tar file. Then read the xml file to get the names of the pictures (done that bit), then use that info in using imagecopyresized to concatenate some of the pictures in the tar into 1 (done this to). The problem i'm having is finding a way to extract the files within the tar so i can use them. Is there any inbuilt php functions to help me do this? I know there is zlib with its gz functions but isn't that just for gz tar files?and if you don't understand i have a tar file with these files in it:a.jpgb.jpgc.jpgd.jpge.jpginfo.xmlUsing the xml file i can get the names of the images i want to use, so my xml file tells me that the images i want to use are b.jpg, c.jpg and d.jpg. I have used imagecopyresized() to add these pictures into 1. I just need to find a way of getting the files out of the tar file. Maybe extract them to a temporary directory, then delete them after use.I'm still quite a new person with php and no nothing really about tar files [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]Thanks and hope you understand :) Quote Link to comment https://forums.phpfreaks.com/topic/10844-extracting-tar-files-using-php/ Share on other sites More sharing options...
poirot Posted May 31, 2006 Share Posted May 31, 2006 Well, unless you want to code your own tar functions, you can try to use ready classes:[a href=\"http://www.phpconcept.net/pcltar/index.en.php\" target=\"_blank\"]http://www.phpconcept.net/pcltar/index.en.php[/a]Or try to find a TAR class here:[a href=\"http://www.phpclasses.org\" target=\"_blank\"]http://www.phpclasses.org[/a] Quote Link to comment https://forums.phpfreaks.com/topic/10844-extracting-tar-files-using-php/#findComment-40580 Share on other sites More sharing options...
vinnieza Posted May 31, 2006 Author Share Posted May 31, 2006 Thanks :)Used [a href=\"http://pear.php.net/package/Archive_Tar\" target=\"_blank\"]http://pear.php.net/package/Archive_Tar[/a] in the end. Was annoying though; when creating tars on my apache server on windows i was using files with no extensions and their location as "filename/", which worked in windows (added file and hid it (made it into a folder i think)), but on linux if i try and do that it just says it can't find the file and without the "/" it doesn't hide them. Shame as i wanted to do this. But for normal use it's perfect :) Quote Link to comment https://forums.phpfreaks.com/topic/10844-extracting-tar-files-using-php/#findComment-40726 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.