-
Notifications
You must be signed in to change notification settings - Fork 176
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
Use two upload zones #59
Comments
You can use more than one # app/config/config.yml
oneup_uploader:
mappings:
images:
frontend: dropzone
documents:
frontend: dropzone Be sure to set the correct endpoint in your templates:
|
Thanks for the quick response. Perfect. But my question now is: How can I control that in the first one only images are allowed to be uploaded and in the second one only documents (no images)? Thank you again. |
Take a look at the configuration reference. You can use the built in mime type validators: # app/config/config.yml
oneup_uploader:
mappings:
images:
frontend: dropzone
allowed_mimetypes: ["image/gif", "image/jpeg", "image/png", ...]
documents:
frontend: dropzone
allowed_mimetypes: ["application/pdf", ...] Note:
|
Oh that's great!! because I am using Dropzone.js and it also gives you the option to filter type, but I am calling it for images and documents, and I couldn't do it. Your solution is perfect. The last problem I have is that I am using dropzone.css for both, and I need different views for each one. Could you help me with this? Thanks! |
I'm afraid this does not lie within the scope of this bundle. But the CSS file assigns its rules to the class Anything that is not about the backend part, should be asked either on the dropzone repo if it is an issue or Stackoverflow for questions. :) |
Ok, y have changed the css and it works perfect! Also, I have changed the allowed types in app/config/config.yml and the files that are not specified there are not uploaded, but when I execute it in chrome, for instance (remember, I am using dropzone.js) looks like it has been uploaded (it shows a green tick). That's why I need to use different dropzone.js for each uploader zones, so I can specify in them the allowed types. |
@sheeep Thanks for the bundle, I have got everything working until now on blueimp. I have added an additional input field(selection) as to let the me choose the type(group1, group2) of the image for database entry no folder change. I havent been able to get the value of the selected in the EventListener. |
I followed the instructions above but I have the following error: This is my code: In the routing.yml is the following: In my twig: I tried also to substitute "documents" with "images" but it seems it takes only "gallery". Any idea? |
Ok, I've found the solution. I had to clear the cache, even if it seems weird to me, maybe because when symfony2 imports the config.yml into config_dev.yml it retrieves the copy from the cache instead of the original copy just modified. The bundle is very good ;-) |
Hi, I am using this bundle with Dropzone. What I am wondering now is how to use two:
How can I handle this?
Thanks in advance.
The text was updated successfully, but these errors were encountered: