I'm looking to create a "file generator", for want of a better word. However, I'm open to creative suggestions as to how to do this.
Essentially what I want is this:
However, what I'll settle for, is something like this:
That sounds fairly straightforward. In PHP alone, it would be.
Unfortunately, I'm working with a school Virtual Learning Environment. I have to create Netvibes UWA Format widgets (in JavaScript) and use AJAX (AHAH, strictly speaking) calls to communicate with the PHP.
Presuming I thus can't create the documents I want with JavaScript (can't appear to find any half-decent PDF libraries, and I don't want to be limited to one file format anyway), is there any way I can make a call to my PHP script then have it send a file back for the JavaScript code to in some way deal with?
I'm not sure I can make the PHP script directories accessible to all users via the VLE, so simply sending a link back after creating the file with PHP won't work.
Thanks in advance,
To expand on my comment;
btoa
the data to make a base64 string (alternatively do this server side and send this back, bigger internet usage but I'm not sure how well XMLHttpRequest handles binary data) 'data:application/octet-stream;base64,'
to get a data URI window.location.href
(or some iframe) to this URI, page won't change as it will do download behaviour.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.