Is there any way to upload file directly from URL in filemanager of cPanel

Shiva picture Shiva · Apr 2, 2014 · Viewed 16.1k times · Source

This might be a very common question but i searched lot and finally decided to get some expert advice.

I was wondering if someone have uploaded file directly from URL to cPanel file manager. I can upload file from my computer using upload tab in file manager but not able to find any option for extracting data from URL.

I have tried several forums, Q/A websites but got nothing. I will really appreciate if someone can brought this question on to expert's attention.

I have looked

http://forums.cpanel.net/f145/filemanager-upload-url-215911.html

http://forums.cpanel.net/f5/upload-via-url-305691.html

and my other places but found nothing but the question.

Answer

BlissOfBeing picture BlissOfBeing · Aug 6, 2014

I too had this question. Being on a slow connection downloading and then uploading again wasn't an option for me.

There isn't any way to do this through the cPanel filemanager at present. If you don't have access to SSH you can get around it like this:

  1. Create a new file in the filemanager, call it get1.php or whatever and place it in a location you will be able to access on your domain.
  2. In get.php edit the file in the filemanager, and put this code: <?php exec("wget http://domain.com/path-to-file.zip"); ?>

  3. Now navigate to your file you created in step 1 in your browser, so it might be http://domain.com/get1.php

  4. Wait. The page might return a 500 error, thats OK, the wget command should still go through.
  5. In cPanel in your file manager reload the directory where you put get1.php, you will see the file there waiting for you. Done.

Now of course this is highly insecure as any bot or person could just request your get1.php file, so make sure you delete it after your done. This is just a simple hack, any better ideas appreciated.