dropzone.js - how to fire a file upload via api? - dropzone.js

I'm using dropzone.js for file uploading.
I want to know how to fire a file upload via dropzone.js API ... I mean without dragging or input but calling a function passing file path?

What's your use case? Why not just use something that will directly talk to your backend file processing?

Related

iOS Share Extension Dynamic Javascript

I am developing a share extension for iOS 8 and it seem like i can run javascript code on page to grab some information like image urls, etc.
But on the apple document it says that javascript code must be inside a .js file but my javascript code is coming from server and it is dynamic.
Is it possible to run javascript i downloaded from server or can I change js file contents everytime I need to use it?
Thanks
Edit
It seems like it is impossible to change the file.
And if your javascript making asynchronous call the loadItemForTypeIdentifier: options: completionHandler: call is not grabing the end value of async call.

WordPress image upload Using ajax?

I'm making front-end profiler in WordPress. I want to upload user photo from front-end. My entire profile is on WordPress ajax. I simply want to upload photo to wp-content/uploads/.. but from front using ajax. I want two things:
1) Media hook
2) File to post through ajax
Can anyone help me a little. I'm really stuck in this place.
First:
For Wordpress new Media Uploader you should look to this tutorial.
Second:
To handle file uploads in Wordpress, you can use the function wp_handle_upload
Note:
You can use Form Data API to upload files with ajax but it may not work with older browsers. Instead you can do file uploads with iframe.

php codeigniter and new valum ajax upload

I am trying to integrate new valum ajax upload with codeigniter 2.
However the new valum ajax upload is using $_GET to sent file name, while codeigniter 2 upload library always check fileupload using $_FILES.
How do i make it works with each other,
Thank you in advance
Extended upload library. Create MY_upload.php file in your library and make your own function like do_upload(). For example do_Vupload(). And put valum codes inside it or load as another library or include it. There you have own upload method. And use it
$this->upload->do_Vupload();

jQuery.ajax File Upload

We have a modal form with an input of type file. We want to upload the file to the server when the user clicks 'Save'. We don't want to actually refresh the page, but simply close the modal.
Can we upload a file via $.ajax? Otherwise, what tools are available for uploading files behind the scenes?
$.ajax() will work, but you'll do best to specify a POST. See the answer here:
Sending multipart/formdata with jQuery.ajax
Also, this jquery plugin supports file uploads:
http://jquery.malsup.com/form/

How to upload an image using jsonp

Jsonp can be used to fetch data from supporting services but can i use it to upload images. As far as i understand javascript cannot access your file system making it impossible to upload an image using pure javascript techniques.However is there a work around. Can an image be uploaded to a server using jsonp?
I don't think you can just using json. The closest you can get is posting to a seperate iframe. Jquery has a feature where you can post a form to a hidden iframe.
http://aspzone.com/tech/jquery-file-upload-in-asp-net-mvc-without-using-flash/
If you are using jquery: http://plugins.jquery.com/plugin-tags/ajax-upload

Resources