/    Sign up×
Community /Pin to ProfileBookmark

Upload entire local folder contents?

I am looking for advice on a script.

I want the user to upload a ‘folder.zip’ file into a certain folder.

Then the PHP script will unzip this on-the-fly and create a new folder for this to go into.

Can anyone please help me with such a script?

I have the upload form all raring to go for a single ZIP file, but not sure what to do next once it’s uploaded ?

Any help would be brilliant!

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@haroon373Jan 30.2008 — upload both your zip file and attached unzip class file

edit the content of the unzip class file with you zip file

scrap this file using url like :
[CODE]http://yourdomain.com/unzip.php[/CODE]
this will unzip all contents of zip file

hope it helps

[upl-file uuid=e8794c9e-9ad1-4b92-b2b6-463eadb92dbf size=19kB]unzip.txt[/upl-file]
Copy linkTweet thisAlerts:
@invisionauthorJan 30.2008 — Thanks for your speedy reply.

I uploaded my zip file.

And tried unzip.php using the zip file, changed the PHP file part: if(file_exists('ebulletin1.zip')) {

$zip = new dUnzip2('ebulletin1.zip');

$zip->debug = false;

$zip->getList();

$zip->unzipAll();

}

however, I just get a number of errors for every file, such as:
[code=php]Warning: mkdir(/home/mysiteuk/public_html//ebulletin1) [function.mkdir]: Permission denied in /home/mysiteuk/public_html/unzip.php on line 191

Warning: fopen(/home/mysiteuk/public_html//ebulletin1/g.html) [function.fopen]: failed to open stream: No such file or directory in /home/mysiteuk/public_html/unzip.php on line 5
file_put_contents: Cannot create file /mysiteuk/public_html//ebulletin1/g.html[/code]


Do you have any ideas why this may be happening?
Copy linkTweet thisAlerts:
@haroon373Feb 02.2008 — Thanks for your speedy reply.

I uploaded my zip file.

And tried unzip.php using the zip file, changed the PHP file part: if(file_exists('ebulletin1.zip')) {

$zip = new dUnzip2('ebulletin1.zip');

$zip->debug = false;

$zip->getList();

$zip->unzipAll();

}

however, I just get a number of errors for every file, such as:
[code=php]Warning: mkdir(/home/mysiteuk/public_html//ebulletin1) [function.mkdir]: Permission denied in /home/mysiteuk/public_html/unzip.php on line 191

Warning: fopen(/home/mysiteuk/public_html//ebulletin1/g.html) [function.fopen]: failed to open stream: No such file or directory in /home/mysiteuk/public_html/unzip.php on line 5
file_put_contents: Cannot create file /mysiteuk/public_html//ebulletin1/g.html[/code]


Do you have any ideas why this may be happening?[/QUOTE]


you don't have write permission on directory

just make possible and change permission to 0777

if you can
×

Success!

Help @invision spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...