Jump to content

Yearbook admin


pconkie

Recommended Posts

@Graham Quince

Hey Graham,

Could you find out what line to add to this to so that the file uploader only uploads image files?

Also, if is it possible to limit the number of files to say one?

Thanks

 

 '[data-action=upload] click': function(el, ev) {
   ev.preventDefault();
   $('.os_core:first').trigger('os.app.upload', {
     "data": {
       "upload_type": "asset",
       "file_ext": "jpg",
       "site_uuid": "54AE54F3200254FB47F31FCC1EA58705E082717C10860FE0",
       "callback": function(result) {

       }
     }
   });
 },

 

Link to comment
Share on other sites

Thanks Graham.  I'd thought about that (and using a file drop in an assignment as well) but I'm worried about a few things with the form approach.

1. Students can upload files if a file uploader is placed on the form, but I can't find a way that they can delete a previous upload.  If they upload more than one photo, how will I know which photo to use?

2. I could easily download all of the files as this is built into the data viewer (and they come in a nice zip folder), but how difficult is it going to be to work out which photo has come form which student?  My little test suggests that this is going to be really difficult.

3. It also isn't going to be that easy to work out who hasn't submitted an entry as the form is based on submissions rather than the members of a group.

 

Link to comment
Share on other sites

@pconkie - hmm, so good points, I'd not considered.  I'll bring these up with the product team.

 

In the meantime, Adam O has replied to me:

$('.os_core:first').trigger('os.app.upload', {
     "data": {
       "upload_type": "asset",
       "filter": ["image"],
       "site_uuid": "54AE54F3200254FB47F31FCC1EA58705E082717C10860FE0",
       "callback": function(result) {

       }
     }
   });
Quote
You can pass filter array in the API filter: ['image']
other options to pass to filter if you want are: video, audio, generic, pdf, tgz, csv and filename

EDIT

Doesn't sound like there's an option to limit the number of files though

 

EDIT 2

The filename filter intrigued me, so I asked about how to use it:

Quote
hey, good question, it looks like you need to provide a full resource object as extra param so:
filter: ['filename'],
uploadResource: resource_object
it then uses that resources object r.getName()+'.'+r.getExtension()

 

Edited by Graham Quince
Added more info
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, pconkie said:

3. It also isn't going to be that easy to work out who hasn't submitted an entry as the form is based on submissions rather than the members of a group.

 

The Who has Completed my Form widget could help with this - but I think you approach for files is probably the deciding factor.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...