Upload first

alt=
DannyA
@dannya
7 years ago
584 posts
Currently, the workflow for adding media to the system is, first you 'add new' to create entry, then you upload the media file afterward.

I want to let user upload first. If you look at youtube as an example, the upload button pops up an upload interface. You select or drag the file to upload. While the file is uploading and converting, you can enter additional metadata.

How can we achieve this workflow in JR? It seems that I can't upload the media until AFTER I put in metadata, and submit form in order to create the record first.


updated by @dannya: 05/16/17 02:37:32AM
michael
@michael
7 years ago
7,746 posts
The creation of the video is done on the same form as giving it a name. You could click the upload button first if you are on a slow internet connection which takes time to upload.

Then fill out the form while its uploading.

You could go into the Form Designer and move the "Upload a new video file" button to the top of the form if you liked too.
brian
@brian
7 years ago
10,148 posts
You could also hide all form fields on CREATE except the file upload, then use a custom module listener to redirect to the MODIFY after upload.

It's doable, but would require some custom stuff.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
7 years ago
584 posts
So, assume the user drags the file and it starts uploading right away. We have not hit "upload" or "submit" then. We can assume the title will be extracted from the file name. Would you automatically save the entry and then updated if the user started changing the metadata (e.g. titile).

Again I will refer to the youtube example. Once I drag the file to the upload area, it starts uploading. No further action is needed. However, if I do add/change metadata and submit, the record is updated.

What I don't understand is how the record is linked with the uploaded file if the page state hasn't changed.
alt=
DannyA
@dannya
7 years ago
584 posts
Thanks Brian. I think what you are talking about is on the right track. Can you provide any more detail?
brian
@brian
7 years ago
10,148 posts
DannyA:
Thanks Brian. I think what you are talking about is on the right track. Can you provide any more detail?

In the form designer for the form you want to modify, turn off everything you can except the file upload field.

Then, in your custom module you'll want to listen for the "form_result" event, and if it matches your save view - i.e. "create_save", then do a jrCore_location() call and redirect the user to the modify form.

Note that you'll also want to setup a 'db_create_item' listener so you can watch for the audio item being created so you can grab the created ID, which you will need in the jrCore_location call when redirecting the browser to the update form.

Let me know if that helps.

p.s. we've not ever actually ever done, so I'm just posting what I _think_ will work - you'll probably need to play with it a bit to get it working how you want.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
7 years ago
584 posts
Ok. Thanks. We'll try it.

Tags