I try to develop a cordova project for cross-platforms. I have to upload photos to a server from gallery or with camera. And also i should show their thumbnails or small previews.
Gallery and camera option works in browser but in android when i try to select and image and upload. It uploads but doesn't show little image.
Thanks.
It's my html
And my javascript code
The FileTransfer object provides a way to upload files using an HTTP multi-part POST or PUT request, and to download files.To install this plugin simply run Command
cordova plugin add cordova-plugin-file-transfer
Properties
onprogress: Called with a ProgressEvent whenever a new chunk of data
is transferred. (Function)
Methods
upload: Sends a file to a server.
download: Downloads a file from server.
abort: Aborts an in-progress transfer.
Read about the FileTransfer you will get their example code of upload file and download file.
Related
I'm trying to upload a pdf file to my browser, but I want to be able to download this file afterwards. I am having problems on the second task - downloading it.
I'm uploading as follow:
<b-form-file v-model="form.file" :state="Boolean(form.file)" placeholder="Choose a file..."></b-form-file>
How can I download form.file content after upload is done?
Edit:
I found this API, which handles file downloads nicely.
You need to save the file somewhere on your server or on a storage service (ie Amazon S3) and then redirect the user to a link where the file itself is served.
The specific implementation is based on your backend implementation and your architectural choices.
Media library is not displayed neither I can upload nor I can see the uploaded media files. So kindly help me out to this situation.
Just by uploading files into the wp-content/uploads won't show up in the Media Library , those media ID's needs to be there in the database to show up in the Media Library.
If you already have files in the uploads folder and want to add them into the database, you can use this plugin to add files from server.
But this is not the correct solution instead fix the permissions issue for that uploads folder.
This issue is shown by following issue
Does your server have the right permission for upload file into upload folder check it.
don't upload file directly to upload folder upload it by backend which will not added media information to database.
I'm writing an esay live blogging app.
I have a form in the backend and I can upload to the server text messages or images.
At this moment everything is working with a simple file upload field, but I want to speed up the process so:
1) reflex camera attached via USB that save images in a local folder on my mac
2) a "preview" of the folder in the backend, updating live while I shoot picture
3) when I select a shot I will upload to the server (this is not difficult).
I cannot find the right plugin to "watch" and interact a local directory. Any idea?
I'm using HTML5 file API to upload files to my web application.
I have an input element on my web page using which I read files and call upload function
<input type="file">
$('input[type="file"]').on("change",function(e){
console.log(this.files);
// upload each file in this.files
});
This works perfectly for native files on os. I want to now upload remote files e.g., example.com/blah/file1.jpg My question is how do I read this file using File API? Is there a way to do it?
You can download remote files over XMLHttpRequest, and process them as Blob. Then upload it to another server. The upload has to be over XMLHttpRequest. It relies on the browser's implementation of XHR Level 2. This link contains the code snippets you will need:
http://www.html5rocks.com/en/tutorials/file/xhr2/
It has both snippets for downloading remote file as a Blob and uploading a Blob to a server.
I'm working on an iphone app, that would read pdf files from the folder on web server.
I made the part of app which read PDF files and everthing is fine, now i'm trying to figure out how to load all pdf files from http:/www.blabla.com/pdf, so everytime i upload new pdf, the app would automaticly load it.
Is this possibile, and anybody has ideas how can be done?
This can only be done, by either having Directory Index enabled, or using a server side language such as PHP to read the contents of that folder and output the filenames.