I need to upload multiple files (doc, jpg, pdf) and want to do this via Ajax. There are several description for clientside code, for instant here. So this part is covered well. But I did not find a counterpart description how to laod and store those docs with SSJS code on a domino server.
Can anyone give some hints where to find a description or may have some code snippets ?
Also it would be interesting to learn about incremental upload methods.
As ever, it's worth checking OpenNTF. Here are a couple of controls designed for that, YouAtNotes HTML5 Multiple File Upload and XPages Async Multiple File Uploader.
Related
Is there any library that can parse and generate a PNG from a Doc, Docx and PDF file?
We're implementing a training system using Node, Sails.js, Express and SQL and would like to generate some PNG image tiles for training modules based on a file upload.
I've done some searching and found some libraries in C# that can do all 3, as well as a just PDF impementation for Node but can't find anything that does more than that.
A point towards any 3rd party libraries or standard implementations of this method would be great.
Thanks
You can do that sort of stuff with C# (probably only on Windows) because C# is from MS stables, the same stable that churns out doc and docx. I am not sure whether the same implementation would work on Linux or Mac (even with Mono).
If you want to achieve this in NodeJS, just create the app in C#, wrap it in a ReSTful cover and call this ReSTful service in NodeJS (via Kue or something similar).
Honestly, converting file formats is a compute intensive process process. I wouldn't recommend it doing it the same main thread any way. If you're anyway gonna spawn a worker, you might as well do it in C# where it's perhaps faster.
Not necessarily an exact match for your requirement, but since you mentioned training purpose, I would recommend Watson Developer Cloud - it has document conversion among many other features which may be relevant and useful for your objective as a whole.
Speaking of the current problem, please see Document conversion overview to see how we can convert a PDF into a desired format such as HTML. Then you could actually get the PNG files from the HTML resource bundle.
Hope this helps.
When a PDF with form fields is rendered in the Foxit web viewer (WEB SDK product), and then is completed by the user, signed, and submitted, is it possible for server-side code to get the bytes of the completed document, not just the data from its form fields?
Yes. For example you are using Java in the backend. I guess in your scenario, your PDFs are hosted on the server(like you have 10 registration forms on the server and your customer can fill them out online). Since those files are on the server, just use Java to read them from the file system using its path. Something like this,
Reading a plain text file in Java
If this scenario does not well describe what you have, please share part of your code and I will be more than happy to help.
the answer to this question must be so trivial because I can't find anything that spells it out for me.
I'm trying to set up a database on cloudant but I keep hearing that to abide the same origin policy the html files will need to be hosted in the same location.
How do I get my html files onto my cloudant domain?
I feel pretty stupid that I haven't been able to figure this out for myself.
You can host static sites on Cloudant similarly to CouchDB. Your best "Getting Started" resource is probably CouchApp.org which explains the mechanism and provides links to tooling which will help you bundle the assets together.
It's also worth mentioning that Cloudant now supports CORS so an externally hosted site is possible as well.
As attachments.
Upload your files as attachments and then access them by going to https://you.cloudant.com/dbname/documentid/name_of_file.html.
Tools like erica (a bigger list of options here) will do that for you. With them, you just need to put all your HTML, CSS and JS files in a folder and the tool will save them all as attachments of a Design Document, then that bundle will become your Couchapp.
(After that you just have to mix some ajax calls to _views and pure docs with links to _list and _show functions -- if you want -- and you'll be a complete couchapper).
I am making a simple form using Alloy UI. It has an image upload field. I want to restrict image file size say, to less than 10MB.
I have tried <aui:validator name="min"> and <aui:validator name="max"> in my view.jsp.
But, this is not working.
What should be used here to restrict image file size?
It seems you want a validation of file size on the client side i.e. using Alloy UI javascript, so I am sorry to bring to your notice that this is not possible in pre-HTML5 browsers due to some security reasons but this is possible with browsers which support the File-API in HTML5. Here is a good-demo site for the file-API.
So for now I would suggest that you do this server-side as a fallback mechanism & there are different plugins available to help you do this using Ajax or just go with plain server-side validation.
You can also try using flash with alloy-ui to check file-size as liferay does in its Documents & Media portlet. The drawback with this approach is that it requires flash to be installed in your browser.
Here is a SO answer which may help you give more information about client-side validation alongwith a demo.
Hope this would give you some lead.
YUI user guides are really nice, please visit http://yuilibrary.com/yui/docs/event/ for example,I just wanna write documents like that. My question is: these documents were generated by some tools like Dockbook,Sphix or written by hand?
The YUI User Guides are generated from Mustache templates using a tool called Selleck. Selleck is a Node.js tool that generates pages from different templates based on the information provided in a component.json file and a predefined folder structure. One of the coolest features of this tool is that it has a --server mode which runs a local web server in which you can see the changes you made live by just refreshing the page.
You can check it out at http://yui.github.com/selleck/.