Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Recursive File Saving/zipping


it will keep the structure, copy it to a zip file/tar.gz/rar or whatever and email it as an attachment. Say the script is in my server root.

script.php
folder1/
folder1/index.php
folder1/images/
folder1/images/logo.jpg
folder1/images/header.gif
folder2/files/super.zip
folder9/some/etc.txt

script.php would keep the file structure for everything beneath it and compress it and email it. I have been trying to find something like this online, but have been having trouble. this is pretty much just for a backup cron job that.




View Complete Forum Thread with Replies

Related Forum Messages:
Un-zipping File Problem
Below is a bit of code that opens up and reads a
zip file.

I'm having trouble working out how to read in line
by line. The file I am unzipping is a CSV file and I
need to return each line so I can work on them

$zip = zip_open("$filepath"); // << full path of the file
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip, $zip_entry, "r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
print "$buf<br>
"; // << what to return each line so i can work
on it
zip_entry_close($zip_entry);
}
echo "<br>
";
}
zip_close($zip);
}

View Replies !
PHP Exec() And Zipping Upload File In Windows
I have the following code. What I need is to zip the file
(c:webuploadsomeFile) to d:websomeFile.zip.

$cmd = 'c:zipzip.exe '. $movedFile. ' '. $finalFile;
exec( $cmd, $cmd_output );

File is being uploaded by the apache server, but it's not being zipped.
My guess "", escaping, is causing problem in windows path. Do I also
have to escape the $movedFile content? Forexample $movedFile=
"c:webuploadsomeFile".

View Replies !
Recursive File Search
question about a recursive file search.
I'd like to do a recursive search for jpg-files and add the filenames (full
path) to a mysql database.

View Replies !
Update Array Within Recursive Function Passed By Ref To Recursive Function - How?
I'm writing a recursive function which iterates through a data array containing indexed and associative arrays. When an associative array of the form ['name->i,'value'->j] meets certain criteria I want to add an additional key/val pair to the array ('insert'->1). Code:

View Replies !
Saving File
When saving the file, I would like let the user to browse through the directory where they want to save the file (like window pop up sreen). may I know is it can be done using php?

View Replies !
Saving A File
I have uploaded a file to my server, does anybody have example phpcode to save this file into a database, and then for me to get this from the database.

View Replies !
Saving To A Text File.
I haven't been able to find a way to save the results of a MYsql query into a tab delimited text file... Anyone know how to do this, or if there are any already written scripts out there that perform this, or a similar function?

View Replies !
Saving To A .php File With A Php Script
Can I write a script that would change the .php file? As in save changes to it.

For instance, if I wanted to have a password variable that could change (I realize I can store the value in a database...that's my back up plan). The next session would have to have the new variable value...not the original one that I coded in.

View Replies !
Saving A Variable With '$' To A File
I am creating a config.php on the fly during a user setup period. here is my code (edited for readablity):

1.) $filepointer=fopen"http://www.mysite.org/newusers/" . $SESSION_UID . "/config.php", "w+");

2.) $data = "<? $name = '" . $SESSION_VARSAVE . "' ?>";
3.) fputs($filepointer, $data);
4.) fclose($filepointer);

This isn't working. Line 2 is wrong. I want my config.php file to containthe below line, where VARSAVE will change depending on the user: <? $name="Web Page Title." ?>

This is used for populating php pages and the viewer does NOT log-in. Anybody who visits the page needs to see the web page title. How can I format line 2 properly?

View Replies !
Saving A File From One Server To Another
I'm half-way there with this, but I need some assistance, please. I'm
attempting to save a JPG file from one server to another. I'm using
fopen() to open the remote file, fread to get the contents, closing,
using fwrite(rb) to open a new file on my server, writing the contents,
and closing. However, it seems that I'm not getting the entire file
from the remote server.

Am I going about this wrong? Is there a better, easier way (that
doesn't involve CURL or any of those other acronyms) to get these
images?

View Replies !
Saving A Decoded Php File
What i am doing is getting a pregenrated label in either php,tif,jpeg or gif...(currently it is pdf) and what i want to do is get the image save the image with a unique file name and save the path into mysql db and save the file on to my server. the image is incoded with base 64. so far i have decoded the image so this is were i am at

$LabelImage = "$DeliveryConfirmationLabel[1]";

echo base64_decode($LabelImage);

when i echo the file apears in a pdf viewer..

so far i have tryed to save the file but i just can't seem to get it to work.... here is my code

$LabelImage = "$DeliveryConfirmationLabel[1]";

$decodeimage = base64_decode($LabelImage);
this so far i know works...
and then something like this

$data = $decodeimage;
header('Content-type: application/pdf');
header('Content-disposition: inline; filename=decodedimage.pdf');
header('Content-length: ' . strlen($data));

then something like this

fwrite($data, decodedimage.pdf)

I don't have a good grasp of what is going on...
i am having a hard time with fwrite() all the examples i read have me open a file with

$filepointer = fopen("nameoffile.txt","w")

and then it has me close the file with
fclose($filepointer)

or fwrite

but they are making the assumption that i have a saved file that i am working with...

View Replies !
Saving CSV File To Read From Php
Let me explain what I am trying to do first. I want to upload a .csv
file from a form page to the redhat server. Uploading is working fine, I could upload the .csv file to the server. But when I open the uploaded file using VI editor in the server, I see "^M" characters and all CSV formats are disappeared. Also "fgetcsv()"...

View Replies !
Saving A Textarea To A .txt File
Basically that's my question right there. I'm trying to find a way to save the text in a textarea field to a .txt file.

Right now I have a script that's supposed to do the same thing, but for a .css file, and it's not working. I know this is a bit of a big request, if you want I can post the current script I'm using.

View Replies !
GD - Saving Output To A File
I have a script which creates a very simple image on the fly, using an array from a seperate file. It displays the 5 previous songs I have listened to in iTunes.

However, I'm trying to code it for use as a forum and myspace image, so it needs to be an acceptable file for both cases. Preferably a jpeg or gif.

Is it possible to output the final result from the GD code to a seperate image file that is updated on time-schedules, or processing a jpeg file as php coding in a way which would allow the image to be displayed?

View Replies !
File Upload And Saving
if I make a php script then any HTML I put in it will work but php is displayed as text and dosent work if its not in html tags, or it dosent work but isnt displayed if it is in html tags, but any PHP on the web that I see works perfectly, I dont want to buy anything or use any trials though. I'd like to be able to use the following features which I know for sure that SOME of it is possible:

Use File Upload / FTP
Save to specific places
Save something with a save dialog
Move Files
Delete Files
Edit Web Page Code That The Script Created
Edit And Manipulate Image Files, Text Files, e.t.c.

if anything on that list isn't possible and what other types of scripts I could use, or if its.

View Replies !
Saving Txt File With Utf-8 Format
I want to save file just like as if i open a new text file in window and write any language in UTF-8 format in it and hit save as button i found Encoding at bottom make it UTF-8 and save. i am using this script but it not working

$f=fopen("qadeer.txt", "wb");
$text="xEFxBBxBF".$data_string;
fputs($f, $text);
fclose($f);

it file save the data in qadeer.txt file but the data related to UTF-8 of chienes language ....

View Replies !
Saving A Log File For SQL Operations
I'm wondering if I could create a log file containing all operations/statments done on my database using phpMyAdmin. I'm suspecting a bug/injection attack and I wanna trace the problem. Can this be done?

View Replies !
Saving To Text File
How would I make form with 2 text boxes 1 is username and 2 is password and 1 button that when you click it, it will save the username anf password into 2 speract text files. Break down: A register program.

Writes the username in 1 text (user.txt) and password in another (pass.txt)
If some one could do this for me I would be so greatful!

View Replies !
Output File Without Saving
I've seen a few sites that offer this, but I'm not sure how they do it.
It's a form button, that when pressed, prompts the use to download a
file. Like if I want my banking records, I select a date range and
press the button, and it compiles and sends me an excel doc right then.

What I'd like is to comile and deliver a file in that manner, without
saving the file to some directory and providing a link. Does anyone
know how this is done?

View Replies !
Problems Saving Gd Generated File
I'm using the gd library to build graphs from db generated data. I can output the result to the browser with no problems, but when I try to save the image, I get the following error message.

View Replies !
Saving/downloading A Dynamic File
Is there a way of making a PHP script go to a URL, like
www.somedomain.com/file?id=2, and saving the dynamic file that is created?

I want to run this script in crontab, so it downloads the file every hour. I have tried using wget, but that doesn't seem to save the dynamic file created, it just saves the blank HTML page "file?id=2".

View Replies !
Saving Output As An .html File
I have a script which takes about 20 or so fields as input and creates a big table out of all those. I want to log what happens and I was wondering if there's some way I can save each table as an .html file in my directory.

View Replies !
Saving A File Received By A Form
I am just another newbie programmer in PHP and web developping and in
the three days I have been messing up with it I have been able to do
all the things I wished except one. When I receive variables from a
form, like a string with the name I can read them with $_POST["name"]
without problem. But when the form sends to me a file, I haven't found
how to save it into my system.

I guess I can access to it with $_POST["file"], fopen it, and then do
fread and fwrite in another file. But this seems to me like a too much
unconfortable way of doing it, so I ask here what is the normal way of
saving a file sent by a form.

View Replies !
Saving Mysql Data To CSV File
Does anyone now how to save Data from a mysql database to a comma delimited file that can be read by excel.

View Replies !
Saving Data To Text File
I have a php form that I'm trying to save to a text file to be accessed by flash later on. I'm able to get the text file created but nothing ever writes too it. I have 29 variables that need to be recorded to be accessed later . . . can someone help me out here? Following another tutorial to make sure i had it set up correctly (that's still debatable) here's the form code:

View Replies !
Saving File To A Folder On The Server
I am working on a control panel for a hosting site. I am working on a script to save out a file to whatever folder you are in.

I have a great script to graphically show the working directory and it will go into folders when you click on them. Now, I have a link to create a file which pops up a window with a basic file editor to type in content and a filename. Code:

View Replies !
Saving Output Of PHP File To Variable
I've got a script i wrote that is piecing together a CSV. Part of this task is to include HTML code inside of the CSV.

What i'm trying to do is save the output of a file like text_file.php to a variable like $text_file_output. I can't figure out a way to include the output of a PHP page to a variable.

View Replies !
Saving A File With A Form Insert
I have a form that I use to insert info about items into a database. One of the fields is the item's image. I have a field of type 'File" where I can browse to the location of the image and select it. When I submit the form, it only gets the file-name part, not the path. I realize that the path on the local machine means nothing to the script running on the server. How can I modify the form or the script so that once the user selects a file name, I can copy it to a location on the server so the script can access it later?

View Replies !
Saving To Plain Text File
I want to do exactly is open a file that essentially has alot of variables stored in it like this.

$names = 'joe¦bob¦clem'
$phone = ?¦323232'

And it just goes on like that for a few hundred variables. Now all I want to do is open the file up find a certain variable and then just add the string I have to it. So like I have the new $names variable and it contains 'joe¦bob¦clem¦chris' and I just want to save that string to the file. I know it's possible but I usually work only with mySQL so I don't know how to open a file find where I want to edit, edit it and then save the file.

View Replies !
Saving And Finding A String In A File
I have a little problem with a script I am writing. It's a voting script with a weekly poll. Users can vote once per week. I want it to record the user who voted. I tried this, but it just seems to write the part: PHP Code:

// Log who voted
$user = $_SESSION['user'];
$vf = fopen("voted.txt",'a');
fwrite($vf,"$user
");
fclose($vf);

And I would like to know how I can have my script check if a user voted already. The username is stored in a session string $_SESSION['user']. I tried this but it doesn't seem to do anything at all: PHP Code:

View Replies !
Zipping
Basically - I want to develop some routines that I can 'read' a file
(ascii / text) that has been zipped up...

I have not found the right command to actually zip up the file in the first place. (automatically via a PHP script)...

Can someone point me to a tutorial / page on actually zipping up files
- into a zip file please...

View Replies !
Saving XML File With Iso-8859-1 Encoding Fails
The question might sound (and probably is;-) stupid, but why doesnt the
follwing code work?? Is there something i dont see?

$doc = new DOMDocument(&#391;.0', 'iso-8859-1');
$doc->formatOutput = true;

$root = $doc->createElement('root');
$root = $doc->appendChild($root);

$head = $doc->createElement('head');
$head = $root->appendChild($head);

$title = $doc->createElement('title');
$title = $head->appendChild($title);

/* probably the real sign gets killed,
so here is the html: &auml; (an umlaut) */
$text = $doc->createTextNode('ä');
$text = $title->appendChild($text);

echo $doc->saveXML();

View Replies !
Saving Query Results As Excel File
One of the users of my web site wants to save the results of a query as an excel or csv file. What is the best way to allow the user to do this using php?

View Replies !
Saving/converting Carriage Return To File
Im making a simple News script for my website. Its all working, Posting news via form which make a new file on the server and retrieving a list of those files and extracting the data from them etc. Code:

View Replies !
Saving Text File To Users Desktop
I'd like to have a script that would save a text file to the users desktop (or any location they request if that not too complexed).

$filename ="text.txt";
$myFile= fopen($filename,'a');
$string="This is what is saved";
fputs($myfile, $string);
$fclose($myfile);

The code above will write to a file that 'already' exsits on the server but I want to generate the file from scratch and have it save on the users computer. I'll be using data from mysql db.

View Replies !
Downloading A Remote File, And Saving It Locally
Im trying to retrieve a remote text file, and save it locally, downloading a new version every 2/3mins.

Im no expert with PHP so am trying to base it off a script I have where it downloads the file and saves it locally every 15mins (overwriting the previous one).

Ive tried mess around with the code, and I can get it to save the file locally with the correct filename, but I cant get it to download a new file everytime.

This is the portion of code I have trying to achieve the above..anyone know how to solve the problem? Code:

View Replies !
Dynamic Zipping
I'm working on a downloads site at the moment and need to have a sort of dynamic zipping system, i'll explain:

1. A user visits the site, they are given an individual ID

2. They browse through the files and can click on the 'Add to Download' button if they wish.

3. If they click on the 'Get Download' button, then they are sent to a page, which offers them all the files they selected in a .zip or .tar file for downloading.

View Replies !
Zipping And Raring With Php
How can i zip or rar a file with php?

View Replies !
Zipping Files
I would like to have a form where users select checkboxes that correspond to the files they are interested in receiving. Then have php "package" those files as 1 (i.e. zip or some other compression format) for immediate download.

View Replies !
Html Form Processing - Saving Data To A File...
ok.. basically, what I'm doing is setting up a very basic news script base on flatfile storage (mostly to teach myself PHP by doing, which is the best way I've found to learn).

set up the php and the html templates first, and all that works fine. I set up the admin menu, and have a edit config script that works great (edits the config and file locations values via an admin form)

now, am working on a script for the admin to edit those html template files directly from the admin panel.

example template editing form:

View Replies !
Saving Data From A Form Into A Seperate .html File
I wrote this script here but I cannot get the script to save to the
correct month.html. Can someone tell me what is wrong with this code?

View Replies !
Saving A Dynamic Php-file As Static Html (on The Server)...
- I have a problem trying to save a dynamic php/mySQL online order form as static html on the server - I'm not really sure this is possible at all - but my problem is that the order-form consists of a lot of items (100+) + the customer data - and we simply don'y have the kind of database capacity to store each order in a database.
As stated earlier I don't know if this is possible? - the static files should also be named after variables so that it would be possible to search a directory on the server for specific orders (that is $blah_$blaah.html) - but that's not a problem - I know how to do that.

View Replies !
Database Class Allowing Saving Data To (XML?) File
I'm looking for a PHP database class which allows database connections
to mysql, AND (text/XML) files to store information.

I'm looking to use the file storage in a small intranet usage of my
programming, and the database (mysql) storage in an online (internet)
site.

If anyone knows of any open-source PHP code for this,

View Replies !
Extracting Mysql Database And Saving It As A Excel File
i realy need help on this ive looked every where but cant find an answer, i dont even know if it is possible. you see im developing a database application, but the client now wishes to be able to export the data from the database and open it in excel i know you can do this using phpmyadmin but i need a script which ....

View Replies !
Zipping All Files In Directory
I need to come up with a script hat will zip all the files in a directory at download. I am working with a virtual host and couldn't tell you if they have any zipping functions compiled with php.

Can i still do this? Also how would i find out if the zipping functions are compiled in php?

I have never done this before and am drawing a blank on what i should be looking for or at.

Thanks guys

View Replies !
Download A Directory Without Zipping
I have groupings of files in different folders. The users have the option of downloading each file individually or the entire folder that that file is in.

is there a way for me to allow the user to download the entire folder without me having to zip the folder? Like sometimes on torrent you can download something and it shows up in a folder unzipped. Any ideas?

View Replies !
Zipping External Files
I was wondering if its possible to build a zip for external files, specifically images. I havnt used PHP's zip features before and if it can't do what I want it to, I don't wanna spend time learning how to use it so im wondering if theres anybody that knows the answer to this question or someone who is experienced and is willing to try it out for me /

View Replies !
Zipping Up A Folder And Its Contents?
I installed the zip extension for PHP 5.2, but reading the documentation, I can't figure out how to zip up an existing folder.  I mean, I have this folder with a bunch of files in it, right?  I *could* scan the whole thing and add each file to a newly created zip archive, but I don't want to.

Is there any way to tell PHP to zip up a folder and have its contents be everything inside that folder?

View Replies !
Zipping Multiple Files
i am working on a php page, process_extract_papers.php, that helps to zip documents for me. One problem i faced was that when the documents are more than 20mb, the system will fail and thats because it exceeds the temp directory memory. And instead of zipping one big file, i want to zip multiple files instead. Firstly, it will be much easier to download. The problem is that i managed to zip the first file and able to download it. So get the next part of the file, i will need to press a button called Extract Next. However, even though i did that, when i press start download button, i will still be downloading the first file.

View Replies !
Zipping Multiple Files Using Gzencode
I'm successfully using gzencode to zip a file using the following code ala the documentation: PHP Code:

View Replies !
Active, Online Zipping Or Rar'ing.
i want to upload something through a form, and have the script do some sort of compression file, like:

.zip
.rar
.tar.gz

etc...

if it makes any difference, it is a unix machine.

View Replies !
PHP Class/library Zipping Client Computer Files And Upload To Server
Can anyone suggest good PHP class/library that can zip client local
files and upload to the server? Single package is great as well as
separate packages.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved