Whenever I attempt to use the mass upload feature via plupload, it uploads all the data fine, then redirects the small upload popup to the single-image popup page. Attempting to use the single upload page merely results in the single upload-ed image being imported.

This issue occurrs on both firefox and webkit browsers. (Chrome, safari, etc.)

Comments

dirksonii’s picture

Also doesn't appear to work in internet explorer.

dirksonii’s picture

This issue is still outstanding

camdarley’s picture

Same issue for my Drupal 7 installation. Mass Upload doesn't work on both Safari and Firefox. I didn't test on Chrome or IE.

JacobSingh’s picture

I can't reproduce this. Can you provide the versions of media / styles / plupload and Drupal core you're using and steps to reproduce?

camdarley’s picture

Drupal 7.0
Media 7.x-1.0-beta3
Styles 7.x-2.0-alpha5
Plupload integration module 7.x-1.0-beta1

JacobSingh’s picture

Hmm... should work. Any other debugging information available? watchdog logs, JS errors, etc?

camdarley’s picture

No, no entry in the drupal log, no js errors, tested on local and remote server with same issue...
I also have errors like this http://drupal.org/node/903466 although i use the last version of views, but i don't thinks that's linked.
Very strange. I'm going to use the devel module to have more informations...

camdarley’s picture

I don't know how plupload works but i did another test with firefox and firebug.
I sent one file of 3M. click on "upload" button launch 4 successive POST requests with this params:

Host	events.#####.com
User-Agent	Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13
Accept	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language	fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding	gzip,deflate
Accept-Charset	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive	115
Connection	keep-alive
Content-Type	multipart/form-data; boundary=----pluploadboundaryp15ops2b1t1p0jvh43501jjdidf4
Referer	http://events.#####.com/media/browser?render=media-popup&types=&activePlugins=&disabledPlugins%5B%5D=library&multiselect=true&plugins=undefined
Content-Length	1049129
Cookie	Drupal.toolbar.collapsed=0; Drupal.tableDrag.showWeight=0; has_js=1; SESS1ceb9b4e812383a7c992235b72e74876=dRQ0osv0u2oEyQY93p0nT1NTdq4DRH9_nr0y0Urg1nA

And i get this JSON response for each :
{"jsonrpc" : "2.0", "result" : null, "id" : "id"}
I don't know if it could help...

camdarley’s picture

Sorry, for other reason, i commented this lines:

  // Check the file name for security reasons
  if (empty($file_name) || !preg_match('/^[\w\._]+\.tmp$/', $file_name)) {
    die('{"jsonrpc" : "2.0", "error" : {"code": 105, "message": "Invalid temporary file name."}, "id" : "id"}');
  }

After uncommented i get this message in the json response :
{"jsonrpc" : "2.0", "error" : {"code": 105, "message": "Invalid temporary file name."}, "id" : "id"}
For more precise information, i modified the function like this :

// Check the file name for security reasons
  if (empty($file_name))  {
    die('{"jsonrpc" : "2.0", "error" : {"code": 105, "message": "No temporary file."}, "id" : "id"}');
  }
  if (!preg_match('/^[\w\._]+\.tmp$/', $file_name)) {
    die('{"jsonrpc" : "2.0", "error" : {"code": 106, "message": "Invalid temporary file name."}, "id" : "id"}');
  }

And now i get this json :
{"jsonrpc" : "2.0", "error" : {"code": 106, "message": "Invalid temporary file name."}, "id" : "id"}
The file i'm trying to upload have just six letter, no special caracters and end by ".jpg"

JacobSingh’s picture

Huh, maybe use error_log($file) to debug the filename you've got there so we know why it is failing?

camdarley’s picture

Adding error_log($file_name);
Uploading "test.jpg' return "p15oq0524boifetpjbi1de69q4.jpg" in the error log

camdarley’s picture

I get it working using this patch :
http://drupal.org/files/issues/plupload-workaround-22.patch
from this issue :
http://drupal.org/node/953242
Trying each patch's additions, it seems that one make the mass upload working :

+  // @TODO: find better solution here  http://drupal.org/node/953242#comment-3977310
+  // upload bug workaround: for some reason $form_state['input'] doesn't have any
+  // data in it, when plupload_element_value is called
+  if(!isset($_SESSION['_plupload_files'])) {
+		$_SESSION['_plupload_files'] = array();
+	}    
+  $_FILES['file']['tmpname'] = $file_name;
+  $_SESSION['_plupload_files'][] = $_FILES['file'];
+  // END WORKAROUND
JacobSingh’s picture

What webserver / OS are you using?

camdarley’s picture

I tested on a remote server (don't know what OS running it) and on a MAMP server running on OSX. Same issue using IE8 from Windows 7.

JacobSingh’s picture

Weird... Did you try w/ a clean install? Maybe using the Media dev profile?

camdarley’s picture

I just tested with a clean install... now i have exactly this issue : http://drupal.org/node/953242

JacobSingh’s picture

Is this still an issue with the latest dev?

camdarley’s picture

Status: Active » Closed (fixed)

No that's working now. Thanks and sorry for not having changed the status sooner.