-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Uploading only valid images #822
Comments
The plugin does not send any FILES for upload to server when validation error is encountered (as is expected and as you mentioned So yes this is a logic to be more handled at your server end ...as you mentioned for your specific use case - whenever files are received empty at server end. On the resizeImage part - the plugin relies on the canvas-to-blob third party plugin by blueimp... check if there is any config there to handle an invalid file for blob conversion... and I will keep it open for enhancement. |
You problably did not understand what I had on my mind. Do you agree that FILES should be empty always when error is encountered, even if resizeImage is true? |
While trying to debug this problem I ran into another one: fiddle |
New enhancements have been added for preventing upload when data is empty. New property |
It solve issue only in small part. I want to explain you this issue, can we talk by hangout/skype? |
Suppose you mean issue #823... its resolved there. |
Your enhancement along with fixed #823 resolved issue. Now everything is working fine 👍 |
@kartik-v I was wrong, there is still one problem. Consider |
@kartik-v Now it is working, except case when last image is invalid. I forgot to mention that you should add this code after increasing counter:
|
@kartik-v I was wrong, issue still persist. Lets select one invalid with one valid image and click upload. Then we get request for each image, even for invalid. Now we can only click "cancel" button and after uploading next valid image previous dissapear! You can watch it on video. What is the reason for uploading invalid images? Can just upload function skip invalid images or delete them? |
@kartik-v What about this? |
Not got the time to check this.. will update... once I get time. |
Curretly when eg. minImageWidth is setted and user select both correct and incorrect files he is still able to click upload button:
and it trigger uploading for every file:
The problem is that on server side when
$_FILES['input']
is empty, we cannot simply return{'error':'No files found for upload.'}
, because$_FILES['input']
is also empty when invalid file is uploaded. Let's tell we will return{}
in this case, but there is next problem: whenresizeImage
is true and invalid file is uploaded, on server we always receive filenameblob
. So again we can return{}
when filename isblob
, but this has drawback that server cannot handle correct files which has this name.I think extension should skip uploading invalid files and this will simplify implementing server-side. What about changing
upload()
to check whether file frame has class file-preview-error or something like this?The text was updated successfully, but these errors were encountered: