fetch clipboard data - javascript

i need to fetch a Prt Screen Image from the clipboard and save it in the database.
I have never really done the save image in database thing before.

The clipboard lives on the client operating system; unless the user pastes the image into an editor, saves it and uploads it using a form, there's no way you can get that data with HTML and the server side alone.

You can't grab a printscreen of a client by with PHP. PHP is a server side technology and cannot access the client. You'd have to use some kind of client side tech like flash, js or java applet. You might want to retag your question if those are permissible.

Related

Mobile Web App Photo Uploads

Here is our situation:
We have a Web App built on .NET framework using HTML5 and javascript to handle client side data processing. There is also a back end of a Web SQL database (yes-deprecated, in the process to transitioning to WebStorage and this is part of that process) that holds all of the form data so that data is accessible offline. There is a sync button that will upload all of the data to our server (via web method and data adapters). I can provide more details if necessary but that is the gist of the situation.
I want to know the best way to handle photo uploads. We use HTML5
<input type='file'>
and
<input type='file' multiple='multiple'>
to access the file system (photos) and "store" them.
My idea is to store the file location in the database, and then execute the uploads when Sync is pressed, but i'm not sure that is possible on iOS and/or Android. If this solution is possible, can someone point me in the right direction? If not then i'd like to hear ideas on the best way to achieve this without storing the entire photo file in the Web SQL database.

Convert web information to pdf information

I have an internal form that is web-based. Clients insert their information (Name and such) and sign using a signing pad (This is more than an image. It's the speed, pressure, ect of the signature).
I've got this working as PDF's, but the forms NOW need to be web based, and when the clients hit "save" the information they input is converted to PDF. This must be done server side.
Is there a way to program using HTML, JavaScript, or something else to do this?
Or is there a service that will do it automatically on the server?
Nothing can be saved locally.
(Short summary: information fields on local website, client inserts information to fields, signs using signing pad, and all information is sent to server and converted to PDF)
I'm not too familiar with PHP, but could PHP be used to do this? If so, how?
The reason i can't have it client side, is because we're trying to get the whole system to work on Ipads as well as desktop office computers
There are library to build PDF in PHP, for instance fpdf.
In fact there are many libraries out there which allow you to build pdf, you just have to learn their respective APIĀ a little.
Check out TCPDF. It's the PHP library to generate PDFs automatically.
I used FPDF, it's easy to download and the site contains useful tutorials. Good luck
use dompdf. check this link
From here check my answer on this question. You can download dompdf from here

Any way to save HTML Form data to database without webserver/sql?

So currently i'm buidling a local website within work.
one of the feature that needs to be built is a request submission form.
We originally had this email to a central mailbox but we want it to take the form data and save it to a database in this case Access.
Is there any possible way of doing this without using SQL or ASP ? As the website is being build on a local server for all members of staff to access.
In the end all I want to do is create a form the user can submit which is sent to a database. Is it possible or would it be better to stick with the email idea?
It is not possible to save data without a database server. Only thing can be done is cookies in javascript but these will not be available always and will never help you cause..
First of all I would like to say that html/css is client side scripting language, without using server side language you can't save anything. You can use php or javascript(ajax) in order to do that.
Unless you are targeting Safari browsers, you can try using IndexedDB(http://caniuse.com/#feat=indexeddb), a form of local storage supported by major browsers, with no size limit. It can be used carefully to emulate a remote database using a JavaScript object relational mapper.
I strongly suggest you a server :). If you don't want to use sql there are many ways to save data. The simplest would be to write a file on disk with what you need.
Only under Internet Explorer, you can save data into MS Access database for example using ActiveX. But html file must be open locally.
Edit:
If needed I can write you a sample code.

I need to generate a JSON file in browser using (currently) javascript

I have a website that allows users to select a date range from a data set. At least, that's the goal.
What I would like to have happen: the user selects a date range, presses the submit button, and a script generates a JSON file which MATLAB reads to generate the graphs.
Any thoughts on resources to help accomplish this?
You'll need the script that fires off to be server side. JavaScript is client side and can not, in any way, access, modify, or otherwise create files on the client. You'll have to use a language like PHP to create the file.
Example using PHP:
Once the file is created, force a request on the client side to fire asking for the file. Set the PHP header to Content-Disposition: attachment; filename="< Place file name here>".
This will prompt the browser to launch a download prompt allowing the user to download the file.
Hope this helps.
You can use Downloadify, a small Flash component with a Javascript interface that allows you to create files on the client that a user can download. That's what I used in a similar situation.
You could also try and use Data URI but they are a quite limited and browser specific so some issues may arise.
These may be alternative solutions to the previous answer that suggested using server side code to generate the file.

Saving out a javascript object?

Is it possible to save out some javascript object purely on client-side?
My question come from the following workflow: a user enters and posts a text, i do some processing on the server side and return processed text to the user. The user can do some modifications to the returned text, if he doesn't like some processed parts of it. Is there any client-side javascript functionality so the user pressed the button 'save' and it pops a save file dialog as if the user downloaded this file from a server? Or I need a server interaction for example to post the results and return them to the users as a file?
You could implement this functionality with a server side functionality, but not with JavaScript. Pressing 'Save' would create an AJAX call to the server which responds with the file correct headers, making the browser respond with a "Save file" dialog.
No. Unassisted JavaScript cannot save files (IE with activeX/WHS can use the file system, mozilla products may have something here which I have not investigated)
But you can popup a window or write it to an iframe which can be printed to for example PDF which is saved on the client
with javascrpipt you don't have access to the filesystem on the clients pc (except of the cookies). so you have to send him a downloadable file.

Categories