this is my first post here,not sure how things work around here,but hey you gotta start somewhere.
I'm using a package from angular called angular-file-upload to upload images.
Is it possible to use an image from clipboard as input of file-uploader?
This component doesn't support pasting from clipboard.
Please experiment with ClipboardEvent.clipboardData to see how clipboard data is handled.
Also try using the paste event handler to trigger function on user pasting data.
document.addEventListener('paste', my-function);
Lot of security implications are around this event and the browser support is not yet impressive.
But it is a nice ground to do some experiments on.
Related
I would like to (programmatically) convert a text file with questions to a Google form. I want to specify the questions and the questiontypes and their options. Example: the questiontype scale should go from 1 to 7 and should have the label 'not important' for 1 and 'very important' for 7.
I was looking into the Google Spreadsheet API but did not see a solution.
(The Google form API at http://code.lancepollard.com/introducing-the-google-form-api is not an answer to this question)
Google released API for this: https://developers.google.com/apps-script/reference/forms/
This service allows scripts to create, access, and modify Google Forms.
Until Google satisfies this feature request (star the feature on Google's site if you want to vote for it), you could try a non-API approach.
iMacros allows you to record, modify and play back macros that control your web browser. My experiments with Google Drive showed that the basic version (without DirectScreen technology) doesn't record macros properly. I tried it with both the plugin for IE (basic and advanced click mode) and Chrome (the latter has limited iMacro support). FYI, I was able to get iMacros IE plug-in to create questions on mentimeter.com, but the macro recorder gets some input fields wrong (which requires hacking of the macro, double-checking the ATTR= of the TAG commands with the 'Inspect element' feature of Chrome, for example).
Assuming that you can get the TAG commands to produce clicks in the right places in Google Drive, the approach is that you basically write (ideally record) a macro, going through the steps you need to create the form as you would using a browser. Then the macro can be edited (you can use variables in iMacros, get the question/questiontype data from a CSV or user-input dialogs, etc.). Looping in iMacros is crude, however. There's no EOF for a CSV (you basically have to know how many lines are in the file and hard-code the loop in your macro).
There's a way to integrate iMacro calls with VB, etc., but I'm not sure if it's possible with the free versions. There's another angle where you generate code (Javascript) from a macro, and then modify it from there.
Of course, all of these things are more fragile than an API approach long-term. Google could change its presentation layer and it will break your macros.
Seems like Apps Script now has a REST API and SDK's for it. Through Apps Script you can generate Google Forms. This API was really hard to find by trying to google for it and I haven't yet tested it myself, but I am going to build something with it today (hopefully). So far everything looks good.
EDIT: Seems like the REST API I am using works very well for fully automated usage.
In March(2022) google released REST API for google form. API allows basic crud operation & also added support for registering watches on the form to notify whenever either form is updated or a new response is received.
As of now (March 2016), Google Forms APIs allow us to create forms and store them in Google Drive. However, Forms APIs do not allow one programmatically modify the form (such as modify content, add or delete questions, pre-filled data, etc). In other words, the form is static. In order to serve custom, external APIs are needed.
I want to monitor android clipboard and display toast from QPython. Actually, I want to check the clipboard for any changes, if the clipboard has a particular string in it that matches a particular regex, I want to process it (the process is really simple, think of its complexity as converting to uppercase, or some similar easy operation) and display the resulting string in a toast. Also, the script should run in background, so that it can monitor the clipboard even if the foreground app is different (e.g. WhatsApp or browser).
I had written a similar native app, but unfortunately the corresponding Java library doesn't work anymore, so I have to rely on a python module that does the same job.
Is it possible to do this using QPython?
You may want to check out the androidhelper module in QPython, and sl4a module in QPython3.
Both have the ability to toast something on the screen, but not sure about clipboard.
I think you can set the clipboard data, and don't know how to get it.
Documentation can be found here
I was planning to create a new web app based on extjs, but i need to create a file upload area where i can work on file uploading , i have tried drag and drop method in html 5 but we don't need that, we need a method where a user can copy a file whatever it is(not big than 20 mb)and that file location got copied on the clipboard and when we paste the file in the selected area of the uploader and the file gets uploaded, what is the best way to go about this?
There is no general access to the clipboard from browsers these days. There is a flash object called zeroclipboard that can be used for some clipboard access.
For your particular need (if all the data is exchanged within your page), you may not need to use the actual clipboard and perhaps you can just use some global storage to store things that are copied for later paste (using your own copy/paste instead of clipboard operations).
This Specification to achieve this is: http://dev.w3.org/2006/webapi/clipops/
But seens that it isn't implemented in any browser yet (perhaps IE9)
This could help you : https://stackoverflow.com/a/6338207/230526
If not interested in standard based solution, firefox, because of the plugins API, have a workaround for this, that you can see here: https://developer.mozilla.org/en/Using_the_Clipboard
I also found this piece of code that promises to work on Webkit based browsers: http://forum.maxthon.com/viewthread.php?tid=79469&page=1#pid493997
If you need to have all browsers support, then Zero Clipboard as stated here, is the way to go.
UPDATE: Found this Jquery based script ( http://archive.plugins.jquery.com/project/clipboard ), that uses IE native API to access clipboard and Flash to all others. This could be a start point to merge all the others solutions and fallback to flash whether not available.
For Zero Clipboard, there is this one: http://www.steamdev.com/zclip/
I need to implement File Import functionality using EXT JS, I have gone through the examples it were helpful and clear.
Here now i need to import the file of type .txt alone.
For Eg : Once the import pop-up blows, then the "Files of Type should be *.txt"
Please provide the your valuable inputs.
Thanks
Dinesh Kumar A B
Unfortunately, you cannot filter the actual File "Browse" window, unless you are using a Flash implementation or some other way of displaying that window. That window is handled by the browser, and is handled differently across OS' as well as browsers.
This is possible if you were say, writing a C# application, since that application would have access to the actual OS' window controls.
You could implement SWF Upload, or something similar which would allow you to do filtering based on file type.
The upload that you have seen in the examples uses TextField. You can configure it with a regex which allows only names ending with .txt
If the uses picks a non-txt file, the form becomes invalid and cannot be submitted.
I'm trying to upload images (byte arrays) from the client to a database - this works like a charm.
The thing is, I'd like to show the progress of this operation to the user, but the DomainDataSource object doesn't provide any sort of progress-event.
If I call SubmitChanges for each entity it somehow starts to overlap and things get pretty messy, so the following doesn't work.
foreach(T entity in entities)
{
myDomainDataSource.DataView.Add(entity);
myDomainDataSource.SubmitChanges();
}
Anyone got an idea how to show the user the upload progress of those images?
You'll need to upload your images in chunks... which you often need to do anyway, as a single image may run the request limit for the maximum request size.
Once you use a chunked uploading approach, then you can show progress based on how much of the image has been uploaded.
I demonstrated this at TechEd Australia... while this was in 2007, and the code is old, it should largely work, or serve as a starting point. The sample demonstrated how you can use Silverlight to augment ajax to do a multi-file upload. See http://www.nikhilk.net/Entry.aspx?id=169 for a description of the samples. Maybe it helps...