markleusink / Bootstrap4XPages

9 stars 5 forks source link

File uploader #2

Open bkolev opened 10 years ago

bkolev commented 10 years ago

Firstly let me offer my congratulations on your project. It's amazing !

I am writing this, because I can't connect uploaded files to a already created document. Is it possible this trick, or i should use another upload plugin ? I am developing a lawyer system, where each case (each document) need uploaded docs and information. I ran this plugin, I have already uploaded files, everything is OK, but I can't make uploaded files responses to the document, also when I open some case i want to see all attachments responses.

Any advice will be appreciated !

markleusink commented 10 years ago

Are you talking about the jQuery File Upload plugin I integrated on the demos on the http://www.bootstrap4xpages.com site? That demo currently doesn't have a feature to show existing file from a document. To add the files as responses to a current document you need to change the code in the UploadHandler class to create those.

bkolev commented 10 years ago

Yes, I'm talking about jQuery File Upload plugin. And yes, I thought I need to edit the UploadHandler, but I don't know how to get Parent document (unid) to make response. Could you tell me how to get it ?

P.S. today I found little bug (I think) about the size of files which I'm uploading. I increase MAX_FILE_SIZE_BYTES to 10MB. So ... in chrome, after i clicked "START" button, it appears that the file is too large, but In Mozilla works fine.

Thanks !

markleusink commented 10 years ago

Hi Boril,

Sorry for not getting back to you earlier. Pretty hectic around here in preparation for my IBM Connect session.

I'll look into the issue you reported. About the parentUnid: you can do 2 things: on opening on the upload XPage, set a sessionScope variable and read that in the UploadHandler class. Or: send the parent ID along with the file to the server. To do that you need to change the clientside JavaScript a bit. Especially this line:

formData : { 'not' : 'relevant' },

You might want to change that to

formData : { 'parentUnid' : '' },