zend-file

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 it doesn't rename it. Thanks for any help! if($this->_request->isPost()) { $formData = ...

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 upload. There should be all sorts of examples out there, but I just can't find them! Do you kn...

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: <?php class Default_Form_UploadFile extends Zend_Form { public function init() { $this->setAttrib('enctype', 'multipart/form-data'); $this->setMethod('post'); $description ...

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 displayed as a file that can be downloaded. <a href="/upload-location/filename.pdf">Download</a>...

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', false, 10485760) //10MB = 10,485,760 bytes ->setMaxFileSize(10485760) ->setDestinat...

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) ->setDestination(APPLICATION_UPLOADS_DIR); $this->addElement($file); Controller: //excerpt if ($form->isValid($request->getPost()) { $newFi...

Allow empty file inputs in Zend_Form

I have a simple form accomplished with Zend_Form which is retrieving all its parameters from an XML file. Form has a file input which I need to allow empty submits as well. I mean users should have the chance to leave this field empty. I tried various combinations of allowEmpty and required directives but no help. Below is the XML block...

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

Hello, 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 user uploads a file, its stored with this instance of the object in the database ...