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

add validator upload file #284

Merged
merged 6 commits into from Sep 12, 2016
Merged

add validator upload file #284

merged 6 commits into from Sep 12, 2016

Conversation

alavieille
Copy link
Member

@alavieille alavieille commented Sep 7, 2016

[OO-FEATURE] Add possibility to validate a media before upload
[OO-DEPRECATED] SaveMediaManager::isFileAllowed is deprecated and will remove in 2.0
[OO-DEPRECATED] SaveMediaManager::createMediaFromUploadedFile is deprecated and will remove in 2.0 use initializeMediaFromUploadedFile
[OO-DEPRECATED] SaveMediaManager::getFilenameFromChunks is deprecated and will remove in 2.0 use getFileFromChunks

open-orchestra/open-orchestra-media-bundle#234
open-orchestra/open-orchestra-docs#231

* @param string $folderId
*
* @return MediaInterface
*/
public function createMediaFromUploadedFile(UploadedFile $uploadedFile, $filename, $folderId);
public function createMediaFromUploadedFile(UploadedFile $uploadedFile, $folderId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alavieille : maybe introduce a new function and tag the other as deprecated ?

@alavieille
Copy link
Member Author

@ngilain pr upadted

@@ -120,27 +121,28 @@ public function uploadAction($folderId, Request $request)
$uploadedFile = $request->files->get('file');
$saveMediaManager = $this->get('open_orchestra_media_admin.manager.save_media');

if ($uploadedFile && $filename = $saveMediaManager->getFilenameFromChunks($uploadedFile)) {
if ($uploadedFile && $uploadedFile = $saveMediaManager->getFilenameFromChunks($uploadedFile)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alavieille : you need to change the method name if it's now returning an UplodadFile instead of string. Something like getFileFromChunks ?

@alavieille
Copy link
Member Author

@ngilain pr updated

@ngilain
Copy link
Member

ngilain commented Sep 12, 2016

👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants