Is it possible to upload a file as a blob of data using filepicker.io, instead of using the file selection modal? - filepicker.io

I have this problem:
I want to make an interface where the user can drag and drop file uploads. Filepicker.io provides an easy solution to this in the form of filepicker.makeDropPane. However, this feature does not support parallel uploads without the callbacks getting confused.
So I would like to write my own drag/drop interface using standard html5 listeners, and make a direct api upload call to filepicker.io with the actual file data in string form. This way I can write the management of parallel uploads on my own.
Does filepicker.io have an api call that would allow me to do this? I only see these two things:
1) File selection modal
2) Auto drag-drop features
I don't see a way to simply upload a file directly from file data.
What can I do?

You should make use of the filepicker.store() command, which accepts a DOM file object. For example:
var input = document.getElementById("store-input");
filepicker.store(input, function(FPFile){/*your code here*/});
More details available at https://developers.filepicker.io/docs/web/#store

Related

How to upload the file on Anaplan without initial upload of file through user interface

I was trying to upload files onto the Anaplan platform using the REST API.So there was a note mentioned on the Anaplan.
To upload a file using the API that file must exist in Anaplan. If the file has not been previously uploaded, you must upload it initially using the Anaplan user interface. You can then carry out subsequent uploads of that file using the API.
So I was looking for any way to upload the file onto the Anaplan without going through the user interface. As the above statement in the Anaplan API page suggested that you need to upload through the user interface first. So is there any other way we can get away from that user interface part or not
The first upload is what helps you setup import actions within Anaplan. So, as the documentation states it is going to require some UI activity. Here is a community article to help you further:
https://community.anaplan.com/t5/Anaplan-Platform/Uploading-file-Via-REST-API-and-Triggering-Imports/td-p/51791

Using tHttpRequest to download an Excel File from Sharepoint with Authentication

I want to download an Excel file from Sharepoint and use it as input for a tFileInputExcel component. tHttpRequest seems to be the only component able to download files from a sharepoint server with authentication.
What of course works is to download the file via tHttpRequest, write the response to a file, and load that file with the tFileInputExcel component.
Example, but I don't want it like that.
However, I do not want an intermediate file and use the "stream" functionality of the tFileInputExcel component. What I do not achieve is to convert the downloaded content into a stream that is usable by the excel component:
((java.io.InputStream)globalMap.get("what goes here? And where does it come from?"))
Here's an example using the tFileFetch component, but this component is not able to download from sharepoint with authentication.
You can do it by writing the content returned by tHttpRequest to a ByteArrayOutputStream inside a tJavaFlex, then converting it to a ByteArrayInputStream like this :
Make sure you uncheck "Write response content to file" on tHttpRequest.
In my example I download a text file because I don't have a link to an excel, but it works the same. You can read your file as an input stream like this :
I extended the tHttpRequest component and created tHttpRequestEx. The new component saves a ByteArrayInputStream to the global map which can be read from the tFileInputExcel component:
((java.io.ByteArrayInputStream)globalMap.get("tHttpRequestEx_1_INPUT_STREAM"))
I uploaded the component on exchange.talend.com.
Of course this has the big disadvantage to use a non-standard component. It may be the better solution to stick with the file download, and use tCreateTemporaryFile to deal with the complexity of creating and deleting a file.

Can I pass a FilePicker a custom source using their API

Essentially I'm trying to see if I can use file picker to manage user assets.
With they accelerate bundle you can specify a custom s3 source, but only on their dashboard.
I want users to pick and store to their own folders ( which appears to be possible )
but then also be able to re-use those files they have already picked and stored using filepicker.
Is this possible? by reading through the doc it appears not.
Such a feature is not available so far.
I think the only solution here would be to create a database with user filepicker filelinks.

How can i browse file without uploading in GXT?

i'm beginner with GXT and i'm wondering if there is a way to parse a file and extract some informations without uploading it.
i created a formpanel that contains an uploadFile form but i don't know waht's next, how to get the complete path of the file so i can read/write with java io or how to retrieve the file or is there an alternatif solution, thank you.
Best Regards.
You can do it in some modern browsers using bleeding edge HTML5 apis for which you would need to use GWT JSNI code. There are no api's from GWT team as is.
HTML5 FileReader
FileReader includes four options for reading a file, asynchronously:
FileReader.readAsBinaryString(Blob|File) - The result property will contain the file/blob's data as a binary string.
FileReader.readAsText(Blob|File, opt_encoding) - The result property will contain the file/blob's data as a text string.
FileReader.readAsDataURL(Blob|File) - The result property will contain the file/blob's data encoded as a data URL.
FileReader.readAsArrayBuffer(Blob|File) - The result property will contain the file/blob's data as an ArrayBuffer object.
Example of GWT wrapper over these -
https://github.com/bradrydzewski/gwt-filesystem
You can read about it more from here - How to retrieve file from GWT FileUpload component?
IMHO you cannot read it .
Due to security reasons javascript(gwt) doesn't have access to the system drives files.
http://en.wikipedia.org/wiki/JavaScript#Security
see Opening a file in local file system in javascript
In order to get the file you need to make a server call.
Instead you can do your validation server side and throw proper messages to user.
P.S : i am not considering modern browser concept.What happens if someone opened in other than so called modern browsers?? Will the programm runs same?? Its always better to do server side validation..

Uploading an image in Zend Framework

I am new in Zend Framework and learning it. I want to upload image into my database and display that image in view page. I search lots of tutorial but no step by step guidance. Want a help. Thanks in advance.
You need to take a look on Zend_Form_Element_File in Zend documentation:
The File form element provides a mechanism for supplying file upload
fields to your form. It utilizes Zend_File_Transfer internally to
provide this functionality, and the FormFile view helper as also the
File decorator to display the form element. By default, it uses the
Http transfer adapter, which introspects the $_FILES array and allows
you to attach validators and filters. Validators and filters attached
to the form element are in turn attached to the transfer adapter.
Database side, you need to use a BLOB type to hold your image (I assume you're using MySQL).
However, note that best practices are to store the image path in the database instead of the image itself.
At last, there are tons of tutorials out there that explains precisely how to do what you're looking for, you just need to look for "file upload using zend element file" and you will find them!