upload

Renaming an uploaded file using Multer doesn't work (Express.js)

柔情痞子 提交于 2019-12-03 16:59:29
问题 I'm trying to upload a file from a HTML form using Express.js and Multer. I've managed to save the file to the desired location (a folder named uploads ). However, I'd like to rename the file while uploading it because, by default, Multer gives it a strange name such as: 5257ee6b035926ca99923297c224a1bb Might be a hexadecimal time stamp or so but I need a more explicit name in order to call a script on it later. I've followed the explanation found here but it doesn't do anything more than it

zend framework losing session

这一生的挚爱 提交于 2019-12-03 16:39:15
I am trying to implement a Flash uploader in my Zend framework application but I am having problems with the session. The Flash does not send any cookie headers and this is why the session is lost. I am trying to send the sessionId as a post param and in my bootstrap file I added a session_id($_POST['session_id]) but this doenst seem to work. I am using a MySQL table as session storage I tryed to debug the error and as far as I see, the session_id is set, and the storage returns the corect data from the database but it doesn't seem to be set correctly in the $_SESSION global. And even stranger

Symfony 2 - Best practice to upload an image on Amazon S3

人盡茶涼 提交于 2019-12-03 16:30:26
I have a form in which I have a file field to upload an image. I need to upload this image on Amazon S3. Building this step by step I started to upload the image on the local disk and it's now working. The upload is occurring inside my entity Page as it's recommended to test the success of the upload before to save the entity. I ended up with this chunk of code /** * @ORM\Column(name="objectThumbnail", type="string", length=255, nullable=true) */ protected $objectThumbnail; /** * This is not a column in the database but it's mapping a field from the form * * @Assert\File(maxSize="600000000") *

iphone SDK : Upload image from iphone to a php Server send empty file ?(sample code link inside)

回眸只為那壹抹淺笑 提交于 2019-12-03 16:17:07
I try to send a photo and GPS location to server via PHP here is the PHP part: Copy from here Saving the Uploaded File The examples above create a temporary copy of the uploaded files in the PHP temp folder on the server. The temporary copied files disappears when the script ends. To store the uploaded file we need to copy it to a different location: <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $

PHP: Set max_file_uploads for one file rather than php.ini

别说谁变了你拦得住时间么 提交于 2019-12-03 16:16:07
Like many variables in PHP using ini_set() on a page doesn't actually work. I've recently upgraded my PHP version and found that my multiple image uploader is now capped. After 3 hours of frustration, I've found that my new PHP install has the new "max_file_uploads" parameter set to "20". So only the first 7 images get uploaded (each is in three sizes, 7*3=21). I can now change my php.ini value of "max_file_uploads" to 300, but I'd rather not do that side wide. Is there any way to set that value just for a single file (upload.php)? Could a .htaccess file be used for this? Correction: max_file

How to upload multiple files on Android using the multiple property?

烈酒焚心 提交于 2019-12-03 16:14:18
问题 I got a, <input type="file" multiple accept="image/*" /> and I want my android users to be able to upload multiple files at a time. Users using nexus-5 report being unable to upload multiple files at a time. I also tried adding capture="camera" to the input but this only auto open the camera and only associate one picture at a time again. This works everywhere except on Android. Is there anything I am missing? 回答1: I've hit the same brick wall. I've tried a number of mobile browsers and can't

PHP - Uploading multiple files

99封情书 提交于 2019-12-03 15:40:20
I'm working on a plugin for wordpress and I want to be able to upload multiple pictures from a form. Right now when I have a form for two pictures and submit it empty, my $_FILES array looks like this: Array ( [image] => Array ( [name] => Array ( [1] => [2] => ) [type] => Array ( [1] => [2] => ) [tmp_name] => Array ( [1] => [2] => ) [error] => Array ( [1] => 4 [2] => 4 ) [size] => Array ( [1] => 0 [2] => 0 ) ) ) Now the problem is that I want to use wordpress' upload handler, wp_handle_upload. It expects the $_FILES array as an argument, but only with one file. I guess it can only be two

No error when uploading a really big file in PHP?

限于喜欢 提交于 2019-12-03 15:06:21
问题 I have a PHP form for uploading files and it works fine and displays an error message if something went wrong. This is all good. The problem is when I test with a really big file, it just refreshes the page as if I hadn't sent a file at all, and none of the $_POST variables from the form are even sent to the server. I want to display an error to the user, letting them know that the file is too big. However, I can't do this. Does anyone know what is happening? 回答1: Check your PHP ini file,

Direct upload to s3 without the use of a production server

☆樱花仙子☆ 提交于 2019-12-03 15:03:38
问题 We are creating a media driven website that requires our users to submit very large broadcast quality video files over the internet. We want to cut bandwidth issues out by eliminating the use of our production server (where the website is), and just creating a connection between the user and a s3 account. To make matters even more fun, our hosting service only allows 50MB an upload through PHP... I've looked all over the internet for a feasible solution, can anybody help? A progress bar would

Zend_Form - The mimetype of file 'foto.jpg' could not be detected

牧云@^-^@ 提交于 2019-12-03 14:58:57
I have a Zend_Form with file element like this: ->addElement('file', 'image', array( 'required' => false, 'label' => 'Venue Image', 'validators' => array( array('IsImage', false), array('Size', false, '2097152'), array('Upload', false), ), )) And when I'm using localhost the image is uploaded successfully. But when I move to my hosting the validation error shows for image field. The mimetype of file 'foto.jpg' could not be detected. What can be the reason of this? same thing happened to me, this was crazy stuff, more than 2 hours trying to figure out what's wrong, here is how to fix it: