SBU-BMI / quip_distro

BSD 3-Clause "New" or "Revised" License
30 stars 16 forks source link

Failed image upload not handled. #2

Closed ebremer closed 7 years ago

ebremer commented 7 years ago

Not the post, but a back-end failure which is reported via json on successful http post

ebremer commented 7 years ago

It actually is handled, however, when uploading a image with a duplicate Image Id, it will take some time before the process times out before error handler fires and displays a message. @sharmaashish can the server respond back faster?

sharmaashish commented 7 years ago

maybe the upload form should make an API call to see if it can fetch the image metadata before attempting an upload api/Data/osdMetadataRetriever.php

tkurc commented 7 years ago

We also should check if the image id is already in the database and return an error to the user if it is.

ebremer commented 7 years ago

Ashish, do you have a sample of how this API is called?

sharmaashish commented 7 years ago

https://github.com/camicroscope/caMicroscope/blob/StonyBrook/osdCamicroscope.php#L120 and caMicroscope/js/imagemetadatatools/osdImageMetadata.js

ebremer commented 7 years ago

@sharmaashish there was a cross-site issue using the above API so I just solved it for the 31st using FindAPI which is setup already to allow cross-site. We can change the mechanism post-31. However, although we need a client check to avoid sending image data before find the duplicate Image ID, the server should handle it better than it is.