Freelancer.com

Go Back   Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming
Register Blogs Social Groups CalendarHelp Desk

Reply
LinkBack Thread Tools
Unread 23rd October 2008, 11:27 AM   #1
<LunLun />
War Room Member
 
Sergiu FUNIERU's Avatar
 
Join Date: 2008
Location: ~Virtual = Valea Caselor (Romania)
Posts: 396
Blog Entries: 15
Thanks: 116
Thanked 42 Times in 33 Posts
Lightbulb How to upload your files 10 times faster?

Let's say you want to upload the phpBB script on your server. On many hosts, including GoDaddy, uploading individual, small files takes way much longer than loading one big file.

How to increase the speed of your upload:
1. From all your files and folders, create a zip archive, called upload.zip
2. Create a local file, called upload.php, with the following content.
PHP Code:
<?php 
     
shell_exec("unzip upload.zip"); 
    echo 
"I unzipped all";
?>
3. Upload both upload.zip and upload.php in the desired location
(let's say, in http://yoursite.com/test)

4. Run http://yoursite.com/test/upload.php
to unzip the files on your server.

Compare uploading phpBB (about 1.98 MB - one file) with (7.48 MB = 741 files). By the way, if you download phpBB from phpBB.com, you unzip it and zip it back, you can get a smaller size for the archive.

See also:
How to download your files 10 times faster

Sergiu FUNIERU is offline   Reply With Quote
Unread 26th October 2008, 03:29 PM   #2
Judy K - WSOTD Copywriter
War Room Member
 
Join Date: 2004
Location: San Jose (Silicon Valley), CA , USA.
Posts: 4,752
Blog Entries: 1
Thanks: 569
Thanked 590 Times in 367 Posts
Default Re: How to upload your files 10 times faster?

Alternatively, with many versions of cpanel, you can use the "file manager".

By clicking on the file manager and navigating to the zip file you've uploaded, click on the file.

On the upper-right there will be a "menu" (list of possible actions in text format, not a graphical menu) of possible actions to take with the file, such as move, rename, delete...and... extract.

You simply click on "extract" -- and whamo! Those files get unzipped faster on my server than they do on my local computer! Blindingly fast.

Now ... the files that you are uploading...it's probably best that they are stored in their own folder ... you can also not care and just make sure you create a folder on the server side -- but this is "safer".

So that when you "unzip" the file, it creates a folder and all the other files unzip into that folder.

Nothing worse than having a gazillion files all unzipped into the top-level folder -- and not even knowing for sure which ones were part of the zip file and which were there previously! Yuk

Now ... how much time will this save you?

Well, over 2 years ago, when Butterfly Marketing came out -- owners of the script were informed of this technique as a piece of advice on the forum for Butterfly Marketing Script owners.

And some people said that piece of advice was worth the price they paid for BFM ($1000+).

WHY so many script distributors tell you to unzip the distribution file locally and then upload all the individual files via ftp -- is beyond me!

Speed Read Copy -- 97% Off Value -- RAVE Reviews!
One of the brightest WordPress "Whisperers" hangs out here: http://wpshine.com -- I'm lucky enough to hang out with him. We clean up hacked websites and help you beef up your website & WP security. check us out.
zapseo is online now   Reply With Quote
Unread 26th October 2008, 03:32 PM   #3
<LunLun />
War Room Member
 
Sergiu FUNIERU's Avatar
 
Join Date: 2008
Location: ~Virtual = Valea Caselor (Romania)
Posts: 396
Blog Entries: 15
Thanks: 116
Thanked 42 Times in 33 Posts
Default Re: How to upload your files 10 times faster?

Quote:
Originally Posted by zapseo View Post
WHY so many script distributors tell you to unzip the distribution file locally and then upload all the individual files via ftp -- is beyond me!
Because some have only FTP access, while for others the method I explained is very complicated.


cPanel is very good ... if you have it.
GoDaddy shared hosting accounts don't have cPanel. What do you do only with FTP and no CLI?

Sergiu FUNIERU

Sergiu FUNIERU is offline   Reply With Quote
Unread 29th November 2008, 04:56 AM   #4
PHP Programmer
War Room Member
 
Join Date: 2004
Location: , , .
Posts: 410
Thanks: 22
Thanked 29 Times in 17 Posts
Default Re: How to upload your files 10 times faster?

Cool tips you guys ...

DreamWhipper.com - Personalized email goal reminder so you don't forget
kidino is offline   Reply With Quote
Unread 30th November 2008, 02:58 PM   #5
Richard Soderberg
 
Join Date: 2008
Location: Silicon Valley, California, USA.
Posts: 17
Thanks: 0
Thanked 1 Time in 1 Post
Default ZipArchive::extractTo($destination), for those without shell_exec("unzip")

Quote:
Originally Posted by ForumJoiner View Post
Let's say you want to upload the phpBB script on your server. On many hosts, including GoDaddy, uploading individual, small files takes way much longer than loading one big file.

How to increase the speed of your upload:
1. From all your files and folders, create a zip archive, called upload.zip
2. Create a local file, called upload.php, with the following content.
PHP Code:
<?php 
     
shell_exec("unzip upload.zip"); 
    echo 
"I unzipped all";
?>
If your shell provider does not provide an unzip executable (or restricts use of the shell_exec() function), you could try using the 'zip' module, if available, to extract the archive. It's linked against zlib, so it should be nearly as fast as the unzip binary - and definitely faster than uploading a million files singly through a web form. The PHP.net documentation for this method has this example. I've added a missing error status check.

PHP Code:
<?php
 
= new ZipArchive;
if ((
'upload.zip') === TRUE) {
    if ((
'/home/username/public_html/destination/') === TRUE) {
        echo 
'ok';
    } else {
        echo 
'failed to extract';
    }
    ();
} else {
    echo 
'failed to open';
}
?>
floatingatoll is offline   Reply With Quote
Reply

  Warrior Forum - The #1 Internet Marketing Forum & Marketplace > Warrior Support Forums > Programming

Bookmarks

Tags
faster, files, times, upload

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:26 PM.