I am uploading images using sfWidgetFormInputFile() to the folder MY_PROJECT/WEB/UPLOADS .How to download those files from that path. how to get the path for the uploads folder. And also when i upload a file the file name changes to somthing like this 1f3c6d9bf7b8ebda8b600576c55817c34715a8421.How can i upload with its orginal name? thanks in advance.
I am uploading images using sfWidgetFormInputFile() to the folder MY_PROJECT/WEB/UPLOADS .How to download those
Share
There is an easier way… put a
generateFieldNameFilename()function into your model or form class (whereFieldNameis the camelized name of the field where you store the image).This will open your image in a new tab. If you would like to force download images in your uploads dir put a
.htaccessfile into it (headers module must be enabledsudo a2enmod headers):By the way symfony renames your uploaded files because filenames must be unique in a directory so if you want to keep the original name, the field where you store the filename should be unique and every model should have a separate subdirectory for its files.