Questions tagged [zend-file]

Zend\File is a library that's part of Zend Framework, which is intended to make working with files easier.

29 questions
28
votes
7 answers

PHP: How to rename a file uploaded with Zend_Form_Element_File?

Form: //excerpt $file = new Zend_Form_Element_File('file'); $file->setLabel('File to upload:') ->setRequired(true) ->addValidator('NotEmpty') ->addValidator('Count', false, 1) …
Andrew
  • 227,796
  • 193
  • 515
  • 708
11
votes
3 answers

How to do file uploads with PHP and the Zend Framework?

I am using Zend Framework 1.9.6. I think I've got it pretty much figured out except for the end. This is what I have so far: Form:
Andrew
  • 227,796
  • 193
  • 515
  • 708
7
votes
7 answers

Trying to find an AJAX file upload solution for Zend Framework using jQuery

I'm trying to create an "upload file, and email as an attachment" form where the file starts uploading after it has been selected (like Gmail), before sending the email. I would also like to implement a progress bar to show the status of the…
Andrew
  • 227,796
  • 193
  • 515
  • 708
7
votes
1 answer

How to upload multiple files with Zend framework?

Even if I select 2 or more images, only one gets uploaded. I have a simple form:
Patrioticcow
  • 26,422
  • 75
  • 217
  • 337
6
votes
1 answer

Zend File Upload and Element Decorators

I have the problem, that the following Zend Form throws an error. The problem is the "file"-element and using setElementDecorators. class Products_AddForm extends Zend_Form { function init() { // other form elements... …
frgtv10
  • 5,300
  • 4
  • 30
  • 46
6
votes
1 answer

ZF 2.4 File Validator Required False Doesn't Work

Today I updated to ZF 2.4 to use float validator but unfortunately i realized that my file upload form field gives unexpected error messages. Here is my form object $this->add([ 'name' => 'profileimage', 'type' =>…
6
votes
4 answers

PHP, Zend Framework: How to set the upload max filesize?

I'm setting the upload max filesize in my form: $file = new Zend_Form_Element_File('file'); $file->setLabel('File to upload:') ->setRequired(true) ->addValidator('NotEmpty') ->addValidator('Count', false, 1) ->addValidator('Size',…
Andrew
  • 227,796
  • 193
  • 515
  • 708
5
votes
6 answers

Zend Zend_File_Transfer_Adapter_Http renaming question

I've got a question about renaming a file after it's been uploaded in Zend. I don't know where to put the Rename Filter. Here's what I've got. I've tried moving things around, but I'm lost. Currently it does upload the file to my photos folder, but…
Corey
  • 1,977
  • 4
  • 28
  • 42
3
votes
1 answer

Zend_File_Transfer w/multiple files does not upload equally

Weird title, yes, but the problem is simple; simply aggrevating. I have a form, that I built without using Zend_Form, and it has two file uploads: Here is the chunk of code from…
creativetim
  • 1,138
  • 2
  • 13
  • 26
3
votes
2 answers

Zend Form File, How to indicate to the user that a file was previously uploaded?

I have a zend form that lets the user fill out attributes of an object. For example, a music artist. The form has basic information about the artist, things like name, phone number, address, and what not, but it also has a file upload field. If the…
JoeChin
  • 401
  • 1
  • 4
  • 17
3
votes
3 answers

PHP: Storing file locations...what if overwritten?

I am currently using the Zend Framework and have an upload file form. An authenticated user has the ability to upload a file, which will be stored in a directory in the application, and the location stored in the database. That way it can be…
Andrew
  • 227,796
  • 193
  • 515
  • 708
2
votes
1 answer

Zend form change elements required options to false at runtime

I have a form and having two file upload elements. it is like $data_file_one = $this->createElement('file','data_file_one'); $data_file_one->setRequired(true) ->addValidator('Extension', false, 'csv') …
maniclorn
  • 1,081
  • 3
  • 12
  • 23
2
votes
1 answer

How to upload one file in multiple folders?

How to upload one file in multiple folders using zendframe work. When I tried image saving only in main folder, not saving in sub folders. Here is the code I had used in my controller. $apt = new Zend_File_Transfer_Adapter_Http(); $files =…
user3668438
  • 165
  • 5
  • 18
1
vote
1 answer

Zend Framework - Zend_File_Transfer Upload Handler

When using something like this in Zend: $upload = new Zend_File_Transfer_Adapter_Http(); $upload->setDestination('/some/directory'); $upload->addValidator(x) ->addValidator(y); $upload->receive(); Is the uploaded file uploaded first to a tmp…
tony
  • 160
  • 8
1
vote
2 answers

Zend File Transfer: Problem when uploading a single image

I cannot understand how ->isuploaded() works. I am suppose to upload six images to display on my index page. Now the problem is, in my update function, if I upload only one or two image $upload->isUploaded() returns a false value, but if I decide to…
Varun
  • 45
  • 1
  • 4
1
2