Bug #21288
closedFlash Uploader only works in click menu in file tree, not in right frame
Added by Georg Ringer about 15 years ago. Updated about 6 years ago.
100%
Description
the flash uploader only works when using the click menu in the file tree (2nd frame) and not in the right frame.
when opening the click menu in the right frame and clicking on "upload file" nothing happens.
look at the screenshot for a graphical explanation
(issue imported from #M12253)
Files
flashuploader.gif (8.49 KB) flashuploader.gif | Administrator Admin, 2009-10-16 17:35 | ||
flashuploader.png (6.23 KB) flashuploader.png | Henrik Ziegenhain, 2012-08-02 15:45 |
Updated by Steffen Gebert almost 15 years ago
Problem is that initFlashUploader() is not defined in global scope, but only in a local, reachable from the upload-button on top of file_list.
This initFlashUploader() also takes event as parameter, not path, so it differs a bit.
Updated by Lorenz Ulrich about 13 years ago
I just solved the related bug for DAM and think that it's not a problem to solve this bug. If you're OK with my approach I will provide patches for the core. Currently we have this JavaScript in the file list:
if ($GLOBALS['BE_USER']->uc['enableFlashUploader']) { $this->doc->JScodeArray['flashUploader'] = ' if (top.TYPO3.FileUploadWindow.isFlashAvailable()) { document.observe("dom:loaded", function() { // monitor the button $("button-upload").observe("click", initFlashUploader); function initFlashUploader(event) { // set the page specific options for the flashUploader var flashUploadOptions = { uploadURL: top.TS.PATH_typo3 + "ajax.php", uploadFileSizeLimit: "' . t3lib_div::getMaxUploadFileSize() . '", uploadFileTypes: { allow: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['allow'] . '", deny: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['deny'] . '" }, uploadFilePostName: "upload_1", uploadPostParams: { "file[upload][1][target]": "' . $this->id . '", "file[upload][1][data]": 1, "file[upload][1][charset]": "utf-8", "ajaxID": "TYPO3_tcefile::process" } }; // get the flashUploaderWindow instance from the parent frame var flashUploader = top.TYPO3.FileUploadWindow.getInstance(flashUploadOptions); // add an additional function inside the container to show the checkbox option var infoComponent = new top.Ext.Panel({ autoEl: { tag: "div" }, height: "auto", bodyBorder: false, border: false, hideBorders: true, cls: "t3-upload-window-infopanel", id: "t3-upload-window-infopanel-addition", html: \'<label for="overrideExistingFilesCheckbox"><input id="overrideExistingFilesCheckbox" type="checkbox" onclick="setFlashPostOptionOverwriteExistingFiles(this);" />\' + top.String.format(top.TYPO3.LLL.fileUpload.infoComponentOverrideFiles) + \'</label>\' }); flashUploader.add(infoComponent); // do a reload of this frame once all uploads are done flashUploader.on("totalcomplete", function() { window.location.reload(); }); // this is the callback function that delivers the additional post parameter to the flash application top.setFlashPostOptionOverwriteExistingFiles = function(checkbox) { var uploader = top.TYPO3.getInstance("FileUploadWindow"); if (uploader.isVisible()) { uploader.swf.addPostParam("overwriteExistingFiles", (checkbox.checked == true ? 1 : 0)); } }; event.stop(); }; }); } '; }
This means that the function function initFlashUploader
is only available if the event was triggered from a click to a <a id="button-upload">
. We can put this function before event observer and it will also be available for direct calling from the context menu.
As for the event or path thing we can take a switch: If it's just a mouse click the the <a>-Tag, we use the target as currently ($this->id), if not, we decode the path and use it:
var target; if (typeof(event)=="string") { target = decodeURIComponent(event); alert(target); } else { target = "' . $this->id . '"; }
What do you think?
Updated by Henrik Ziegenhain over 12 years ago
- File flashuploader.png flashuploader.png added
I can confirm this issue for at least 4.5.17 and 4.6.10.
There is a folder-Icon in the upper right corner - upload is also not working here
BTW: I never noticed the folder with its context menu :)
Updated by Gerrit Code Review over 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18480
Updated by Gerrit Code Review over 11 years ago
Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/19211
Updated by Lorenz Ulrich over 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1c58b86d4971c7cd41111aa7072e2822bda12a09.
Updated by Gerrit Code Review over 11 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at https://review.typo3.org/19872
Updated by Ernesto Baschny over 11 years ago
- Status changed from Under Review to Resolved
- Target version deleted (
0) - TYPO3 Version changed from 4.3 to 6.0
Resolved in 6.0.5. Won't backport to 4.5 anymore.