Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getUploadedFiles always returns an empty array #3

Closed
nyxos opened this issue Jul 21, 2015 · 10 comments
Closed

getUploadedFiles always returns an empty array #3

nyxos opened this issue Jul 21, 2015 · 10 comments

Comments

@nyxos
Copy link

nyxos commented Jul 21, 2015

After the successfull upload to the typo3temp I link to a different action. In the actions' controller I try to access the files as described in the manual with: $uploadedFiles = $this->uploadFileService->getUploadedFiles(); but it always returns empty.
Do I have to send some additional params to this action ?

Thanks and best regards,
Stefan.

@fabarea
Copy link
Owner

fabarea commented Jul 24, 2015

Do you have this hidden field in the DOM? What happen to its "value" after uploading a file. You must have a pretty up-to-date version of Media.

<input class="first" id="uploaded-files-images" name="tx_mediaupload_pi1[uploadedFiles][images]" value="" type="hidden">

After upload:

<input class="first" id="uploaded-files-images" name="tx_mediaupload_pi1[uploadedFiles][images]" value="53c7462e-a171-41c8-822f-3b996f3c9018-2014-10-01_1052.png" type="hidden">

@nyxos
Copy link
Author

nyxos commented Jul 24, 2015

Thank you for your time!

I do have this hidden field, here it is before and after upload - it's not changing:

<input id="uploaded-files-nxs" type="hidden" name="tx_mediaupload_pi1[uploadedFiles][nxs]" value=""/>

'nxs' is the property I am using - with this ViewHelper:

<mu:widget.upload storage="2" property="nxs" />

@fabarea
Copy link
Owner

fabarea commented Jul 24, 2015

and after upload - it's not changing

That's the problem. Do you have a JS error? I would need to double check whether I require jQuery in this build. Ideally it must be decoupled from jQuery.

@nyxos
Copy link
Author

nyxos commented Jul 24, 2015

No JS error.
Here's the Console output of Fine Uploader:

[Fine Uploader 5.0.8] Parsing template media_upload.min.js:16 [Fine Uploader 5.0.8] Template parsing complete media_upload.min.js:16 [Fine Uploader 5.0.8] Rendering template in DOM. media_upload.min.js:16 [Fine Uploader 5.0.8] Template rendering complete

@fabarea
Copy link
Owner

fabarea commented Jul 24, 2015

Here would be the source file where to debug at line 92.

https://github.com/fabarea/media_upload/blob/master/Resources/Public/Source/JavaScript/MediaUpload.js#L92

Pay attention, it must be edited in the build file

https://github.com/fabarea/media_upload/blob/master/Resources/Public/Build/media_upload.js#L11254

I am offline for the rest of the day. Hope you can figure out something.

@nyxos
Copy link
Author

nyxos commented Jul 24, 2015

Interesting: I replaced the min.js with the not-min.js and now I got following hidden field:
```

But still: the ->uploadedFiles() is empty.

How can/should I pass this hiddenfield to my processAction ?

@fabarea
Copy link
Owner

fabarea commented Jul 29, 2015

That shouldn't be empty. When specifying the property in the VH, "nxs" in your case, it must also be told in the method as:

$uploadedFiles = $this->uploadFileService->getUploadedFiles('nxs')

I think it was discreetly mentioned in the example of the README.

@fabarea
Copy link
Owner

fabarea commented Jul 29, 2015

Let me know if that does not work for you.

@fabarea fabarea closed this as completed Jul 29, 2015
@jensmarquardt
Copy link

jensmarquardt commented Aug 25, 2018

For me the problem still exists. The VH returns the described hidden field, but the value is always empty. Also uploadedFileList and uploadedFiles in ShowUploadedController.php are always empty.

@caessard
Copy link

I had this problem when I deleted de line 38 in Resources\Private\Templates\ViewHelpers\Widget\Upload\Index.html for remove the 'View' button . When set the line <a class="view-btn btn btn-small btn-info hide" target="_blank">{f:translate(key: 'fineUploader.view')}</a> again, I could have the uploaded files in array again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants