Closed (fixed)
Project:
SWFUpload
Version:
6.x-2.0-beta4
Component:
Miscellaneous
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 May 2010 at 05:59 UTC
Updated:
1 Jul 2010 at 18:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
eugenmayer commentedCannot confirm this.
Dont forget to give the user user permission "upload with swfupload" (group settings) and doublecheck admin/settings/uploads so you have no malformed filefilter. I tried both, having none entered ( no restriction ) and having some files in there like "jpg gif png odf". You see, no dots before the extensions
Comment #2
FranCarstens commentedYup, that's exactly how I have it. I have permissions for SWFupload as well as upload to authenticated, admin and another role. I also have jpg psd pdf as allowed extensions. When trying to upload only those are allowed and everything works fine until it's started uploading and then I get the error message. Again, uploads work for UID 1, but for no other users - with either authenticated, admin or other role. I'm seeing no error messages except the one in the screen shot. Server logs show nothing, neither does Drupal log.
Comment #3
eugenmayer commentedUse the SWFUpload debug mode (debug:true in the settings) and look at the trace
Comment #4
FranCarstens commentedThis is the trace I get. I don't see anything new (I've removed pieces of the upload progress since it's just a repitition.):
---SWFUpload Instance Info---
Version: 2.2.0 2009-03-25
Movie Name: SWFUpload_0
Settings:
upload_url: /swfupload
flash_url: /sites/all/libraries/swfupload/swfupload.swf?preventswfcaching=1274732348717
use_query_string: false
requeue_on_error: false
http_success:
assume_success_timeout: 0
file_post_name: field_album_files
post_params: [object Object]
file_types: *.pdf;*.jpeg;*.jpg;*.ai;*.indd;*.zip
file_types_description:
Upload your albums pages here. Please note the following:
file_size_limit: 0
file_upload_limit: 0
file_queue_limit: 0
debug: true
prevent_swf_caching: true
button_placeholder_id: field_album_files-swfwrapper
button_placeholder: Not Set
button_image_url: /node/add/
button_width: 104
button_height: 28
button_text:
button_text_style: color: #000000; font-size: 16pt;
button_text_top_padding: 0
button_text_left_padding: 0
button_action: -110
button_disabled: false
custom_settings: [object Object]
Event Handlers:
swfupload_loaded_handler assigned: true
file_dialog_start_handler assigned: false
file_queued_handler assigned: true
file_queue_error_handler assigned: true
upload_start_handler assigned: false
upload_progress_handler assigned: true
upload_error_handler assigned: true
upload_success_handler assigned: true
upload_complete_handler assigned: true
debug_handler assigned: true
SWF DEBUG: SWFUpload Init Complete
SWF DEBUG:
SWF DEBUG: ----- SWF DEBUG OUTPUT ----
SWF DEBUG: Build Number: SWFUPLOAD 2.2.0
SWF DEBUG: movieName: SWFUpload_0
SWF DEBUG: Upload URL: /swfupload
SWF DEBUG: File Types String: *.pdf;*.jpeg;*.jpg;*.ai;*.indd;*.zip
SWF DEBUG: Parsed File Types: pdf,jpeg,jpg,ai,indd,zip
SWF DEBUG: HTTP Success: 0
SWF DEBUG: File Types Description:
Upload your albums pages here. Please note the following:
SWF DEBUG:
SWF DEBUG:- Be sure to number pages consecutively for ex. Name_Page01.pdf, Name_Page02.pdf, etc.
- The following formats are allowed: PDF, Jpeg, Adobe™ Illustrator, Adobe™ Indesign or any of these files types compressed as ZIP.
- We suggest uploading a compressed ZIP file to save time selecting files.
SWF DEBUG:
SWF DEBUG:
SWF DEBUG:
(*.pdf;*.jpeg;*.jpg;*.ai;*.indd;*.zip)
SWF DEBUG: File Size Limit: 0 bytes
SWF DEBUG: File Upload Limit: 0
SWF DEBUG: File Queue Limit: 0
SWF DEBUG: Post Params:
SWF DEBUG: op=move_uploaded_file
SWF DEBUG: instance={ "name": "field_album_files" }
SWF DEBUG: widget={ "file_extensions": "pdf jpeg jpg ai indd zip", "file_path": "albums_uploads", "progress_indicator": "bar", "max_filesize_per_file": "", "max_filesize_per_node": "", "max_resolution": "0", "min_resolution": "0", "alt": "", "custom_alt": 0, "title": "", "custom_title": 0, "title_type": "textfield", "default_image": null, "use_default_image": 0, "label": "Album Files", "weight": "-3", "description": "\x3cp\x3eUpload your albums pages here. Please note the following:\x3c/p\x3e\r\n\x3cul\x3e\r\n\x3cli\x3eBe sure to number pages consecutively for ex. Name_Page01.pdf, Name_Page02.pdf, etc.\x3c/li\x3e\r\n\x3cli\x3eThe following formats are allowed: PDF, Jpeg, Adobe™ Illustrator, Adobe™ Indesign or any of these files types compressed as ZIP.\x3c/li\x3e\r\n\x3cli\x3eWe suggest uploading a compressed ZIP file to save time selecting files.\x3c/li\x3e\r\n\x3c/ul\x3e", "type": "swfupload_widget", "module": "swfupload", "list_field": "0", "list_default": 1, "description_field": "0" }
SWF DEBUG: sid=3433302a6465613336313636636538333134633463623162363565613939623766396262
SWF DEBUG: file_path=sites/default/files/albums_uploads
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG:
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.pdf;*.jpeg;*.jpg;*.ai;*.indd;*.zip
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: Global Post Item: op=move_uploaded_file
SWF DEBUG: Global Post Item: instance={ "name": "field_album_files" }
SWF DEBUG: Global Post Item: widget={ "file_extensions": "pdf jpeg jpg ai indd zip", "file_path": "albums_uploads", "progress_indicator": "bar", "max_filesize_per_file": "", "max_filesize_per_node": "", "max_resolution": "0", "min_resolution": "0", "alt": "", "custom_alt": 0, "title": "", "custom_title": 0, "title_type": "textfield", "default_image": null, "use_default_image": 0, "label": "Album Files", "weight": "-3", "description": "\x3cp\x3eUpload your albums pages here. Please note the following:\x3c/p\x3e\r\n\x3cul\x3e\r\n\x3cli\x3eBe sure to number pages consecutively for ex. Name_Page01.pdf, Name_Page02.pdf, etc.\x3c/li\x3e\r\n\x3cli\x3eThe following formats are allowed: PDF, Jpeg, Adobe™ Illustrator, Adobe™ Indesign or any of these files types compressed as ZIP.\x3c/li\x3e\r\n\x3cli\x3eWe suggest uploading a compressed ZIP file to save time selecting files.\x3c/li\x3e\r\n\x3c/ul\x3e", "type": "swfupload_widget", "module": "swfupload", "list_field": "0", "list_default": 1, "description_field": "0" }
SWF DEBUG: Global Post Item: sid=3433302a6465613336313636636538333134633463623162363565613939623766396262
SWF DEBUG: Global Post Item: file_path=sites/default/files/albums_uploads
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /swfupload for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 129024. Total: 1100693
.....etc
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 1100693. Total: 1100693
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: { "op": "upload_complete", "file": 0, "file_path": "sites/default/files/albums_uploads", "instance": { "name": "field_album_files" }, "widget": null, "messages": { "error": [ "The selected file \x3cem\x3eLogo.ai\x3c/em\x3e could not be uploaded. Only files with the following extensions are allowed: \x3cem\x3e\x3c/em\x3e." ], "swfupload_error": [ "There was an error uploading the file" ] } }
SWF DEBUG: Event: uploadComplete : Upload cycle complete.
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: StartUpload(): No files found in the queue.
Comment #5
eugenmayer commentedwell i guess its all about
Well this needs some debugging. Are you able to set a watchdog / dsm at the point where the extensions are checked and see what value it has actually?
Comment #6
eugenmayer commentedconfirmed.
It seems like no filetypes are found when user != 1. Inverstigating
Comment #7
skilip commentedThe allowed extensions array seems to be empty: 'Only files with the following extensions are allowed: '
Comment #8
eugenmayer commentedThe reason is the description field of the upload field. If you use HTML characters there, you will get a hex encoded string in json. json_decode cant handle this.
We need this
plus
Comment #9
skilip commentedComment #10
heine commentedAre you sure swfupload is faulty here? The drupal_to_js core implementation creates broken JSON #479368: D7: Create RFC compliant HTML safe JSON. Maybe swfupload just returns the garbage it received?
If you already rely on the json "extension", why not make a custom drupal_to_js implementation (as the D7 version http://api.drupal.org/api/function/drupal_json_encode/7) until core is fixed.
Comment #11
eugenmayer commentedSounds like the better approach here. I will just use the d7 one.
Comment #12
skilip commented@Heine: I've tried using json_encode instead of drupal_to_js as well. The error still occurs so I assume it is caused by Flash. (I think Steve agrees ;))
Comment #13
skilip commentedNote that this patch runs on BETA4!
Comment #14
eugenmayer commentedpatch looks fine!
Comment #15
skilip commentedComment #16
skilip commented@Heine mentioned the returned data should be also be escaped for json_encode()
Comment #17
skilip commentedMinor changes on the functions comment.
Comment #18
skilip commentedOops, too fast.... sry
Comment #19
eugenmayer commentedMarking critical, is a must for the rc1
Comment #20
sansui commentedSubscribing. Seems like this module is getting pretty close to stable release :) Looking forward to switching over to this from fupload when a few more of these issues are cleaned up :D
Comment #21
eugenmayer commentedThere arent much (any) issues left actually. Help beta testing beta5, it should work quiet well already. This way we can release rc1 early in the future.
Comment #22
eugenmayer commentedApplied in branch http://github.com/EugenMayer/swfupload/tree/797638 ( base was beta 5)
merged into dev
Comment #23
eugenmayer commentedfixed in bet6