PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 7th, 2012, 11:12 PM
tittu9 tittu9 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 3 tittu9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 24 sec
Reputation Power: 0
Question New Member - Php Downloding

Is it possible to download and extract a zip file from a url to my server using php script..
the download to the folder where the php file is placed..

with regards,
TIttu Varghese
IEEE

Reply With Quote
  #2  
Old July 8th, 2012, 04:04 AM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,682 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 2 h 24 m 24 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Yes, but it's not very easy. Or rather it's easier doing it someplace else. Like a bash command: pipe wget or curl into unzip.

Reply With Quote
  #3  
Old July 8th, 2012, 07:07 AM
Northie's Avatar
Northie Northie is offline
Square Peg in a Round Hole
Click here for more information.
 
Join Date: Oct 2007
Location: North Yorkshire, UK
Posts: 3,415 Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 9 h 21 m 40 sec
Reputation Power: 3833
Yes

If you're on *nix system then it's probably even easier.

File_get_contents will get the contents of a file, which you can save to another file if you wish with file_put_contents

Php then has various zip functions - look in the manual

If on the command line, you can do

wget http://URL-of-file.com/file.zip

unzip file.zip -d extract/location


Then you can use exec to run these commands from php
__________________
PHP OOPS! <?php DB::Execute(SQL::makeFrom($_GET))->fetchArray()->FormatWith(Template::getInstance('default'))->printHtml(); ?>

PDO vs mysql_* functions: Find a Migration Guide Here

[ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > New Member - Php Downloding and extracting a zip file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap