473,378 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Download and Extract zip file

16
HI,
Is there a php function that can be used to download a zip file from a different server and then extract it to a specific location on my server?
I want to run this file in cron so it works automatically.

Thanks
Aug 29 '08 #1
3 2957
doc1355
16
OK I found the answer my self.
Here is the code to download a file:

[PHP]<?php
$foo = system('wget http://www.domain.com/file.zip',$output);
?>[/PHP]
Aug 29 '08 #2
doc1355
16
And to extract (unzip) the file use the following code:


[PHP]<?php
exec('unzip file.zip');
?>[/PHP]
Aug 29 '08 #3
Atli
5,058 Expert 4TB
Hi.

Those would be limited only to some Linux distributions.

For a more reliable method, you may want to check out PHP's Zip extension.
Aug 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Keith Clark | last post by:
Yes, I know at the webpage http://msdn.microsoft.com/vstudio/express/visualcsharp/download/default.aspx I can download Visual CSharp Express software. But this is only a 3MB setup wizard...
14
by: ucasesoftware | last post by:
What is the best way to download the application ? Zip ? Cab ? What is the solution to make a .exe and after dw it automaticly extract and install the application ?
4
by: Benny Raymond | last post by:
I've nearly finished my personal auto updater and the only thing left to implement is a hash check against the downloaded file to make sure it's good before extracting it. Right now I havn't...
4
by: cj | last post by:
I have a MSDN subscription and I'm downloading the first CD of VS2005 now. But I'm not sure I'm doing it right. I put a blank CD in the CD drive and told it to write it to D: (the cd drive). It...
7
by: John | last post by:
We have created a game and when the user click on "Download New Songs" which requires the user to download songs. This could be over 20 songs. I have these files zipped on the server in one...
0
by: raymonddaly | last post by:
I have a list of web pages from which I want to extract certain information. I need to download the html from the page, save to a local text file, extract the data I want and save that to another...
2
by: shailen | last post by:
Hello, I have got the link of a running PHP script on a website, when when I try to download it, I get a plain HTML file which opens as the original website. I have tried to paste the link in...
7
by: Sheldon Glickler | last post by:
I have a set of jpg files on a page. I want to give the user the option to downloadd all of them at once. What is the code to do that? It must exist because many times users are presented with a...
3
by: domnulnopcea | last post by:
i have a dinamically generated file! and i have a button on my page... i want to download the file by ajax when i click the button! i tried to send the headers in the xhtmlrequest but my browser...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.