0

I want to make my own image uploader, that supports drag and drop, jQuery AJAX functions to send necessary data to php file. I have a hard time getting started with it, since there are many solutions, but most of them are not-explained plugins, but i wanna make one by my own, to modify it and understand how it works. Any tips, where should i start in order to achieve the goal?

2
  • You should start by examining the source code of those plugins. Commented Feb 29, 2012 at 10:12
  • I'm sure it has been asked many times and doesn't have a solution that you can't (reliably cross-browser) drag/drop file uploads with just Javascript as you can't get the file details from it. Commented Feb 29, 2012 at 10:34

4 Answers 4

2

You'll be limiting yourself to modern Browsers (unless you provide a reasonable fallback). What you're looking for is the FileAPI. With that you can't iterate through directories, though. The File System API exists, but isn't supported widely, yet. SWF upload is flash based solution (I've used numerous times).

You may also want to have a look at Resumable.js. It's doing a nice job of splitting uploads into chunks. This way you can pause/resume uploads, handle really large files, etc.

Sign up to request clarification or add additional context in comments.

Comments

1

First of all, file upload through AJAX is not possible. It's an workaround that uses a hidden iframe as the target of the form. Then capture the iframe's content and do whatever you need. Here's an tutorial you can adapt to your needs.

2 Comments

You missunderstood me, i want my php to upload the file, ajax has to do it asynchrous only.
I think you misunderstood my answer. Of course you need the php to make the file upload. But you cannot send those file to the php file asynchronously as regular AJAX works. You need to read that tutorial first.
1

PLUpload is my preference. Sleek, easy to customize, open source and supports all major technologies from HTML4 to HTML5 to Flash to Silverlight, dependent on your end users configuration

Comments

0

Uploadify is a good way to start what you are trying to achieve.. It uses jquery ajax and php to upload the images.. You can add multiple images as well and it comes with very good documentation. And its really easy to implement & understand. I would suggest you to study how this plugin works in order to achieve what your are trying to do.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.