• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » PHP Script to Download, Upload and Uncompress on FTP

By Abhishek Ghosh September 14, 2012 5:33 pm Updated on September 14, 2012

PHP Script to Download, Upload and Uncompress on FTP

Advertisement

PHP Script to Download, Upload and Uncompress on FTP is easy with a PHP script. It can download from source, uncompress any thing including WordPresslike CMS. Please take the fact that this is actually not a script providing article, the target of this guide to write a PHP Script to Download, Upload and Uncompress on FTP is to make anyone understand, PHP is not very difficult, many modification can be done as per your need.

 

Basics you will need to code PHP Script to Download, Upload and Uncompress on FTP

 

For this guide it is quite obvious that you need a Server with FTP or SFTP access. Shell access is not need. You can use any advanced Text Editor like Gedit. Windows users can also can use Gedit. This is due to the fact they support Syntax Highlighting feature.

 

Basics for PHP Script to Download, Upload and Uncompress on FTP

 

The major problem is, many Open Source Project do not have the rightly configured url for download link. For example, WordPress always makes it latest.tar.gz for any version. So practically to get the URL, you have to browse to the official Website and get the URL manually. For WordPress you can download such a ready made php script to Download, Upload and Uncompress on FTP from our guide Automate Uploading and Uzipping WordPress on Rackspace Cloud Sites. This will obviously give you the way how to use it.

Advertisement

---

 

If you open Gedit and create a new blank file with the name upload.php then, depending on your configuration / settings, PHP Script will automatically get Syntax Highlighting.

 

Basic targets to write the PHP Script to Download, Upload and Uncompress on FTP :

 

  1. Download it from official URL as compress folder and upload to SFTP. This is actually done by wget in case of Shell.
  2. Umcompress it. Equivalent to tar -xzvf function in shell.
  3. Delete the original file,  Equivalent to rm with name of the file.

 

This is how we can do which is simplified from posteet.com/view/1079 :

 

Vim
1
<span style="color: #993300;">&lt;?php</span>

Vim
1
<span style="color: #99cc00;">$url</span> <span style="color: #993300;">=</span> <span style="color: #ff00ff;">"http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.2.tar.gz"</span><span style="color: #993300;">; </span>

 

Vim
1
<span><span style="color: #0000ff;">// Use the latest url within " marks, you can delete these blue lines</span> </span>

Vim
1
<span style="color: #99cc00;">$file</span> <span style="color: #993300;">=</span>

Vim
1
<span style="color: #993300;"><span style="color: #ff00ff;">"mediawiki-1.19.2.tar.gz"</span>; </span><span style="color: #0000ff;">// We are using a short name in above line</span>

Vim
1
<span style="color: #99cc00;">$esc</span> <span style="color: #993300;">=</span>

Vim
1
2
3
4
escapeshellarg(<span style="color: #99cc00;">$url</span>)<span style="color: #993300;">;</span>
exec("wget " . <span style="color: #99cc00;">$esc</span>);
<span style="color: #99cc00;">$shell</span> <span style="color: #993300;">=</span> <span style="color: #ff00ff;">"tar -xzvf <span style="color: #99cc00;">$file</span>"<span style="color: #800000;">;</span> </span>
<span style="color: #0000ff;">//as the file is tar.gz we will use </span><span style="color: #0000ff;">$shell = "unzip $file";  </span>

$shell = escapeshellcmd($shell);
exec($shell,$nu);
$del = “rm $file“;

Vim
1
<span style="color: #99cc00;"><span style="color: #0000ff;">// We need to delete it</span> $del</span><span style="color: #993300;"> =</span> escapeshellcmd(<span style="color: #99cc00;">$del</span>)<span style="color: #993300;">;</span>

Vim
1
exec(<span style="color: #99cc00;">$del</span>,<span style="color: #99cc00;">$nu</span>)<span style="color: #993300;">; <span style="color: #0000ff;">// This will show the word Complete at the end of operation</span> </span>

Vim
1
print_r(<span style="color: #ff00ff;">"Complete!"</span>)<span style="color: #993300;">;</span>

Vim
1
<span style="color: #993300;">?&gt;</span>

 

Like This is your gedit :

 

PHP Script to Download, Upload and Uncompress on FTP

 

This PHP Script to Download, Upload and Uncompress on FTP does the work, but its painful to use. We can reduce the pain by using a form action like this to get a HTML. If you can do it, you will see it is very easy, but some people sells them in Code Canyon like website as premium scripts ! PHP itself is free, for this small lines, is it really honors Open Source ?

 

Signature Tagged With php script download , phpprogramthat performfile up loading and dowload , script download php , script ftp php , script shareasale ftp php , uncompress and upload to ftp

This Article Has Been Shared 917 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to PHP Script to Download, Upload and Uncompress on FTP

  • Syntax Highlighting : All About the Colorful Snippets

    Syntax Highlighting is a method for coloring certain words and characters in a text depending on their importance in in an piece of code or snippet.

  • Installing Piwik on Rackspace Cloud Sites

    Installing Piwik on Rackspace Cloud Sites is very easy and needs few steps. Piwik is an Open Source Server Installable Real Time Web Analytics Software.

  • Installing ownCloud on Rackspace Cloud Sites

    Installing ownCloud on Rackspace Cloud Sites step by step guide. ownCloud is a server software that provides device independent storage of pictures, documents.

  • Installing vBulletin Forum Software on Rackspace Cloud Sites

    Installing vBulletin Forum Software on Rackspace Cloud Sites needs extra works and the difficulty level is a bit higher than WordPress though not very tough.

  • Install Open Journal Systems on Rackspace Cloud Sites

    Install Open Journal Systems on Rackspace Cloud Sites just like any other PHP MySQL based application in easy to follow steps.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What Online Casinos Have No Deposit Bonus in Australia March 30, 2023
  • Four Foolproof Tips To Never Run Out Of Blog Ideas For Your Website March 28, 2023
  • The Interactive Entertainment Serving as a Tech Proving Ground March 28, 2023
  • Is it Good to Run Apache Web server and MySQL Database on Separate Cloud Servers? March 27, 2023
  • Advantages of Cloud Server Over Dedicated Server for Hosting WordPress March 26, 2023

About This Article

Cite this article as: Abhishek Ghosh, "PHP Script to Download, Upload and Uncompress on FTP," in The Customize Windows, September 14, 2012, March 31, 2023, https://thecustomizewindows.com/2012/09/php-script-to-download-upload-and-uncompress-on-ftp-1/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT