I receive a 'Server error!' on any upload. Digging into it, I added the message variable to the output so I could see the code, which is 403 (Forbidden). I though that was possibly because of Apache authentication, so I turned that off, but receive the same error.

In the firebug console, I see no posting activity going on, and am not even certain if the file is making it past the flash.

Comments

aaron’s picture

here's a patch for more useful error messages, btw.

aaron’s picture

Looking at the logs, I now see: access denied for swfupload. Oddly, it's displayed for the Anonymous user, even though I'm authenticated with an admin account with the new required access.

aaron’s picture

same behavior with the super user.

aaron’s picture

seems to be an issue with swfupload_access(). return TRUE allows the upload to progress.

skilip’s picture

Did you try to enable debug modus for the SWFUpload library? I'm wondering which http error number is returned.

$settings['swfupload_settings'][$element['#id']] = array(
'debug' => TRUE,
....
);

aaron’s picture

seems to be at

return (($p->op) && user_access('upload files with swfupload'));

from a dpm(), it looks like $p is an empty object, thus there is no ->op.

aaron’s picture

rather it's not: watchdog printing of $p returns:

stdClass Object ( [Filename] => 100_4101.mov [op] => move_uploaded_file [file_path] => files/videos [instance] => {"name":"field_raw_video"} [widget] => {"file_extensions":"avi mov wmv mpeg mp4 mpeg2 dv 3gp 3g2 mpeg4","file_path":"videos","progress_indicator":"bar","max_filesize_per_file":"","max_filesize_per_node":"","label":"Select video file","weight":"32","description":"","type":"swfupload_widget","module":"swfupload","list_field":"0","list_default":1,"description_field":"0"} [sid] => 312a6434316438636439386630306232303465393830303939386563663834323765 [Upload] => Submit Query ) 

fwiw

aaron’s picture

it's http error 403

skilip’s picture

aaron’s picture

ok, digging further, the session id of d41d8cd98f00b204e9800998ecf8427e (after that's been decoded) does not exist for uid 1. curiouser and curiouser...

aaron’s picture

no, skilip, that's not the issue: if i return TRUE in swfupload_access(), everything seems to work. the issue seems to be that an incorrect sid is being set somewhere.

aaron’s picture

oddly, it seems to be trying for that same unique sid even if i log out and in as another user... the uid is correct in that case, but the sid is not...

aaron’s picture

the issue is that at _post_key(), my $user has no ->sid, so it's being set with the $_SERVER['REMOTE_ADDR']. which, of course, fails when later it's checking that against the sessions table...

aaron’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

this fixes that condition.

aaron’s picture

i'd also suggest the patch at #1, which would make it more useful for admins attempting to debug a problem their users report. slightly easier to have more information for an otherwise hard failure, especially since the alternative is to hack the module to enable debug mode.

eugenmayer’s picture

Title: Server error on all uploads » SID not always correctly restored

iam not sure this is related to

http://drupal.org/node/799444

we should probably use the drupal core method to restore the session, see

http://github.com/EugenMayer/drupalwiki_multiupload/blob/master/drupalwi...

especially the session_sid($sid) is importnat, otherwise you will get problems verifying form tokens.

eugenmayer’s picture

Priority: Normal » Critical

Any opinion here Philip?

eugenmayer’s picture

Status: Needs review » Reviewed & tested by the community

checked in the fix here http://github.com/EugenMayer/swfupload/tree/796916

only added this ( as this can be out of sync )

session_id($user->sid);

to be sure toke validations are working ( keeping both sid and sessed_id in sync )

yes, we have to places where we store the curent sid, user->sid, and session_id. While nearly anthing is using user->sid, form token validation is ussing session_id...well this gives you hard time to debug :)

eugenmayer’s picture

merged into dev

eugenmayer’s picture

Status: Reviewed & tested by the community » Patch (to be ported)
eugenmayer’s picture

Status: Patch (to be ported) » Fixed

fixed in BETA6

pixelsweatshop’s picture

Still getting this in beta6

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

YNWA’s picture

Version: 6.x-2.0-beta3 » 6.x-2.0-beta8
Category: bug » support
Status: Closed (fixed) » Active

Hi everybody!

I'm using version 6.x-2.0-beta8 and I still have 403 error because of wrong SID. Please, help me, what should I place into swfupload_upload_access() to avoid this error?