Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Argument problem

Status
Not open for further replies.

speedyrudolf

Programmer
Sep 2, 2009
27
RO
Hi. I'm trying to get php to fetch some files, but I can't figure out how to do it...here is the code..

Code:
<?php
require("class.easyzip.php");

$zip = new EasyZip;
$zip -> addFile("$_POST['Fis_lay']");
$zip -> addFile("$_POST['Fis_lay']");
$zip -> splitFile("site.zip", 50000);
echo 'Attachment has been sent Successfully.';
?>

I have tried with no quotation marks, no apostrophe, quotation marks instead of apostrophe, but it always sais "Error: file does not exist" of another (very long) error on line 5. Any help is very much appreciated. Bye.
 
$_POST will never contain a file. It may contain a file name but never the actual file.

If you are uploading a file then the file wold be in the $_FILES variable , or somewhere in your servers file system if you've used the move_uploaded_file() function at any time.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
OK...then how do I request a file? The main idea is to have the php get the files directly from the client, before they are uploaded. As you can see from the code, its purpose is to create a plitted archive on the fly. The reason for me doing this is because the server I am on doesn't accept files bigger then 5mb, and the form has a few (about 6) file inputs and to not make the user crate the split archive himself, I gather the files (actually clientside filenames and locations) and create the archive directly on the server. Anyway... I repeat the question...how do I request a file? Thanks.
 
Not from PHP. PHP is a server side language runs on the server. So it can't do anything with the files until they are uploaded.

If you want to split the files before upload you'll need a client side solution.

For example: this Java Applet will split the files:

Then your users can upload the split file parts, to your server. If your server supports split files it should automatically merge them back.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top