-
Notifications
You must be signed in to change notification settings - Fork 5
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
Upload photo information #1250
Comments
Sorry about that. Yes it is possible, there's event that is being triggered when we start uploading each image, we already use it for some other stuff. We can make another ajax call there to store that info. What's the purpose of that and where we should store that stuff? |
@damirius But, more importantly, this is my big idea! Let's store the file name first. Then, if we get a timeout when the FT is in the field, it should be possible for the FT to initiate an independent upload of the all the photos once they have a WiFi connection. This upload sequence would not be subject to any timeout. We just match the photo to the stored file name. Tell me if I am correct. And one more question. Isn't there a comment in dropzone to upload thumbnails? |
Thumbnails are shown in the dropzone field, they aren't actually uploaded on the server. Resize option is popular one dropzone/dropzone#781, but they still didn't add it in the dropzone. |
Read http://www.dropzonejs.com/#enqueuing-file-uploads to queue file upload until the ft clicks the start upload: If you set autoProcessQueue to false, then .processQueue() is never called implicitly. This means that you have to call it yourself when you want to upload all files currently queued. See if we can retrieve the queue in JSON format, save it to the db and reuse it later for upload Here are the steps we think we need to take to validate this possible solution: If those 4 steps are successful, it means we can store the JSON to the database and then later, we retrieve the JSON and repeat step 4 in the situation we want. Can you try that please @damirius ? |
@damirius I dug into dropzone.js. I put a break at line 498 and a watch on the variable |
As I said dropzone is firing few public accessible events on file drop and on file send which can provide us with |
@damirius The "Upload Photos" button could go a number of places, and I haven't decided for certain yet. It seemed moot until we knew whether or not it worked. One option is to include a "Wifi Photo Upload" item on the main menu. Another option is to automatically add a checklist item as soon as a queue is initiated. For now, it really does not matter - you could make a dummy page - whatever is easiest for this development stage. |
More on the subject: Since it is not possible to retrieve the data from Dropzone, I'm investigating a possible solution to store the documents (pictures and pdf) on the FT's device. I'm not sure where yet but I have an idea. Give me a little bit of time to build the case. The goal would be to use Dropzone to store the data on the FT's device and then to the server when the connection is WIFI. Thank you for your help so far 👍 |
So, I have found a possible solution to test out on a dummy to start with. I found a clear enough example (http://blog.jankuca.com/post/7169506266/offline-file-uploads-file-api) with the source code (https://github.com/jankuca/offline-uploader). Basically, we would use IndexedDb (first choice if available) and WebSQL storage to store the documents on the device. There are quota to respect depending on the platform (iOS or Android if we limit ourselves to those). To find out the limit: go here on your mobile devices here and try to fill the storage with 10 chunks of 5mb (50mb) which I think is a large amount of data. To optimise the storage, I think we should resize images down since recent smartphone can take pictures of several MB. @bsaiken : what would be an acceptable image size in pixels? I don't know if we can use Dropzone or not. To be confirmed but I think we must try this as it could be the first step to make the whole app offline. What do you think? Some more reading and resources: |
@FWAJL |
Please definieWhat are your requirements:
I have tried 100 chunks of 500kb (~50MB) with IndexedDB (max. on android 4.4.2) and it still works, online and offline. That represents between 100 and 200 documents in total! We would need to test on lower Android versions (I can test 4.1.2 and 4.4.4) and of iOS. Then we could set a min. platform version that we support because like Souvik said, support is limited but platform updates happens often on recent smartphones. If you dismiss this solution from my first comment, I only see the native apps as the real solution. These HTML5 technologies are the best chances to stick to the Web App. Thank you. |
@FWAJL |
I understand. The reason why I'm talking about resizing pictures is because we don't need to full HD pictures to record a field parameter. However, can you at least provide some start-of-answer to the questions I posed, please:
These questions are to be used to reflect on the need. I will try to make you a mockup but it will probably be outside the repository context. Thank you. |
@gsouvik @WebDevJL Souvik, This has been a real challenge for us to implement. Let me know if you need help understanding the requirement. We could have a Skype chat if needed. The first step would be to implement a simple upload (1 photo only) from the mobile site. I will create a new Milestone with Issues for each step. |
I'm the maintainer of Fine Uploader. Can I be of assistance here in any way as far as answering further questions? |
@rnicholus |
Generally speaking, we like "how do I do this" type of questions to be posted on SO under the fine-uploader tag (which I monitor regularly), and feature/bug reports/requests in our issue tracker. But I'd be happy to provide guidance in this thread for your implementation effort. |
@rnicholus @gsouvik @FWAJL |
If the questions are very specific to your implementation, you can simply ask in this thread, as I am now watching. |
from #1282.
No. This would not help. The technician will need to be able to navigate to other pages and do other work while adding to the upload queue.
I just downloaded the wrong library. Please just download the correct library. |
Note that there is no real advantage to pulling in jQuery-wrapped Fine Uploader. See FineUploader/fine-uploader#1310 for more details. |
@rnicholus |
No. To support this, one of the following would have to be happen:
|
@gsouvik @rnicholus
|
We are already making use of the Filesystem API to accept folder uploads via DnD and the
I'm not sure at the moment, as this is not a web specification that I have much practical experience with. I am fairly certain that this will not be a trivial feature to implement, and I am hesitant to code up a feature as part of the library that can potentially persist large amounts of data to a user's filesystem. This feature could not be unbounded. Complexity follows. However, you could certainly code this up on your end. Simply grab each file from Fine Uploader's API as it is submitted via the |
@rnicholus @gsouvik The question of the level of effort required is directed to Souvik, who would take on the work. If the coding is too complex (a.k.a. expensive) we may need to stand down - I'm a one man shop with limited resources and guile can only get me so far. |
The concept is straightforward, but the devil is always in the details. Though this should be a possible integration given Fine Uploader's comprehensive API. Your biggest obstacle may be browser support. First, only Firefox & Chrome/Opera fully support IndexedDB. IE10+ and Safari for OSX only have partial support for the spec. Also, in typical Apple form, the implementation of IndexedDB was horribly botched in iOS8. They haven't fixed it in iOS9 either as far as I know. I honestly can't give you an accurate estimate as to how much work this will be as I am not very familiar with the details of this API as I have not used it before for anything non-trivial. There is an appropriate example that you will likely benefit from at https://hacks.mozilla.org/2012/02/storing-images-and-files-in-indexeddb/. All said, this doesn't seem like a particularly difficult API to work with (famous last words). Also, I think this will be an interesting integration. If Fine Uploader work ever dies down a bit, I may consider writing a blog post detailing this type of workflow support. |
This is not an obstacle for me since I can specify a browser to my users (if necessary). This is no more restrictive than requiring users to access the site with a custom mobile app. @gsouvik - Souvik, when you consider how we might implement this, I believe our best option is to use Chrome. All my testing will be using Chrome. We only need the mobile UI to work on the mobile version of one browser. |
Keep in mind that Chrome on iOS is, for the most part, just a less
|
@bsaiken
Either way, to store the queue is the biggest challenge and I think we need to do some experiments before we could actually adopt one of the options. Please share your thought, which one you would want me to try. |
Yes, you're right, Souvik. Look at this comment for details about IndexedDb / WebSQL implementation example: #1250 (comment) |
@WebDevJL |
@rnicholus @bsaiken var galleryUploader = new qq.FineUploader({
element: document.getElementById('my-uploader'),
template: 'qq-template-gallery',
request: {
endpoint: config.rootFolder + 'file/upload',
inputName: 'file'
},
form: {
element: document.getElementById('document-upload'),
autoUpload: true
},
thumbnails: {
placeholders: {
waitingPath: 'placeholders/waiting-generic.png',
notAvailablePath: 'placeholders/not_available-generic.png'
}
},
validation: {
allowedExtensions: ['jpeg', 'jpg', 'png']
},
scaling: {
sendOriginal: false,
includeExif: false,
sizes: [
{name: "small", maxSize: 200}
]
}
}); I've used scaling as well as attached a form with it so that everything works with my already coded end point. I've changed the file input name from When I debug the _files superglobal on the server end point this is the output I see: Array
(
[file] => Array
(
[name] => blob
[type] => image/jpeg
[tmp_name] => /private/var/tmp/phpbjAFe0
[error] => 0
[size] => 9010
)
) As you see, the scaled version of the file actually uploads but the original name of the file (which according to fineuploader documentation should have been: "original name" + "small.extension") Could you please let me know if I'm making any configuration mistake or how I may fix it. Let me know if you need more info on the issue. Thank You. |
The name of the scaled file is stored in the qqfilename request parameter. On Wed, Sep 23, 2015 at 12:44 PM Souvik Ghosh [email protected]
|
@rnicholus |
No, and in fact this is not possible cross-browser. |
@damirius
You did not aNswer my question from a different Issue, but this would likely be a new Issue anyway.
Is it possible, when we are uploading a photo, to upload the photo information: timestamp and the file name (as it appears on the mobile device)?
The text was updated successfully, but these errors were encountered: