Hi, I'm trying to create a class CreateFile to create a .txt file.
And a class CreateZip, which achieves a .zip file through one or more paths ...
I can create the .txt files, but not .zip ...
You have ideas?
My code:
$file = new File;
$file->data = 'file_input.txt';//fopen('/file_input.txt', "x");//Input::file('file_input.zip');
$file->disk_name = $disk_name;
$file->file_name = 'file_input.txt';
$file->file_size = '2333';
$file->content_type = 'application/txt';
$file->is_public = true;
$file->save();
$fp = fopen($file->getLocalPath(), "w"); //fopen('/public/'.$path.$disk_name, "xw");
fwrite($fp, '1');
fwrite($fp, '23');
fclose($fp);
with $file can I create the file on the disk and DB system_files
and fopen and fwrite function bat in db content_type = inode/x-empty , file_size = 0
If .txt change in .zip $file does not work completely
Ideas?
Help me
Sorry for my English, I'm Italian