File Upload Widget with Voila Library (ipywidgets) - file-upload

I'm trying to create a jupyter notebook web app using Voila whereby users can upload a JSON file, and then based upon that JSON file a dashboard will be created. I am trying to do this by using the File Upload widget in ipywidgets.
In Voila, it will not run the subsequent cells once you open up the HTML website it creates for you so I am having a lot of trouble trying to get this to work. Any help would be much appreciated.

Related

Directus - create a file in a hook

I am using hooks to update some data when the user uploads a file.
One of the use-cases is that we want to generate a "preview-image" from the input data, upload it and attach it to the item.
https://docs.directus.io/extensions/hooks.html#creating-hooks
How can I access the API or create/save a directus file entry within the hooks?
You should be able to use the API normally within a hook. So you can use the "Create File" endpoint to upload the preview image, within a blocking files.create.before (in v9).
https://github.com/directus/next/blob/main/docs/guides/extensions/api-hooks.md
That said, Directus will automatically create preview images using the thumbnailing system... so you shouldn't even have to build this custom.
https://docs.directus.io/guides/files.html#asset-middleware

Android camera, take picture(s) and save as multipage PDF, then upload to server via <input type="file" />

I have a webform with and want to open it on smartphone - than take pictures of some documents which need to be merged in one PDF, and on the end this file need to be uploaded to server.
My solution is to use Google Drive to upload PDF (scan) to GDrive and then somehow download this file from gdrive to server via some sort of widget (any links appreciate) installed on website.
Maybe someone have a better idea?
I know its late but my answer might help others. I also face the same challenge and implemented a custom solution based on Javascript and Since you are using web form so this solution will perfectly fits on your need.
You have to use JSPdf javascript library, JSPdf provide you pdf object in your browser and you can upload it download it and there are many other thing to play with.
First you have to initialize JSPdf object as per your requirement. I am creating PDF with page size width:500px and height 500px.
pdf = new jsPDF("l", "pt", [500,500]);
Simply when you will take picture from camera you will have each picture in form of base64, that base64 format you have to insert in JSPdf object
pdf.addImage(imgData, 'JPEG', 0, 0);
you can repeat the above code to add pictures from camera as much as you want, at the back-end these images are compiling and creating pdf document where each page have each images in sequence.
Once you are done, you can get PDF object in form of base64 object using below code that you can upload to any server.
pdf.output('datauristring')
above is only pdf part, you can find complete working example including camera part here Javascript Component to Scan Document

Extract graph image using PhantomJs

I use jqplot to create a complex data graph for a clinical web application using IE7. Now, I need to create a PDF and the graph is part of the PDF.
Since it is IE7, I can't export jqplot graph as an image.
My plan is:
From the web app, user clicks on a button to send the graph data (JSON) to a web service on a remote server.
On the remote server, I will have a HTML page to be built dynamically by PhantomJS using the JSON data passed to the web service.
When the page load is complete, I will "rasterize ??" the page to get the graph image.
I will use this image in building my PDF using package like jsPDF.
Return the PDF URI back to the web app.
Does this make any sense at all? I struggle on how to integrate all the moving parts together. Any suggestions?

CMSMS Formbuilder Multi Page Form Not uploading Files

I have created a multi page form using the formbuilder module for CMS Made Simple.
The form is submitting all other fields correctly however the upload file inputs are not uploading to the uploads directory.
I have created other forms that work perfectly using the exact same settings so it seems there is a bug in formbuilder itself for multi page forms however I am unable to figure out what it is to be able to fix it.
Does anyone have any suggestions as to why the files are not being uploaded.
Once this is fixed it will also be attached to the email that is sent as the form is submitted but this is an easy fix (just un ticking the box).
Thanks in advance.
The issue is a bug in the formbuilder module itself. A request was made on the CMSMS forge but no replies have been received.
Unfortunately there is no fix so depending on the version of formbuilder you are using you will not be able to upload files if you have a multi page form.

how to add a pdf file and view it in a Page based application

Actually i want to load a pdf file and view it like similar to page based application.So can anyone suggest me how to do it with sample code.I searched i didnt find any documentation or any sample code.
You want to create eBook type of app. https://github.com/brow/leaves the link example shows how to load pdf file and show. and if you want to add more animation like page curl then refer example here http://blog.steventroughtonsmith.com/2010/02/apples-ibooks-dynamic-page-curl.html