Monday, December 4, 2006

Image uploading using AJAX

Well, i guess i'm feeling Hot today ;)
Two posts within 24 hours, wow... lol
Well, i've been working on a project and was looking for an existing Image uploader that uses AJAX, knowing in advanced that really it's impossible (except for FF) to use xmlHTTPRequest, i was looking for a solution that uses iFrame, while googling it, it wasn't hard to come up with Asynchronous image file upload without AJAX by Martin Konicek. So i went ahead and downloaded it. After setting it up the first time, i got real bugged that it supported only Jpeg, when you'd upload something otherwise, it will just show an X instead of the image, that is not acceptable when you are creating a system for a client. Unless you want to give him a "Do not do" list for your product.
So i started playing with the code, while reading through, found out some really annoying stuff and fixed it according to my ideology. Unfortunately while doing that i didn't know i will actually re-release the code, so i didn't comment out all the changes i've made, but the most major ones are:
Support for JPEG,GIF,WBMP and PNG. (All credit goes to Huda M Elmatsani which class i used to do the conversion 'i.e had to modify that script as well').
The script doesn't throw an error in FF saying that it can't work out the setTimeOut.
The script doesn't trying to read the uploaded file information when no file has been uploaded, and is not trying to upload a file when the uploaded file field is empty.
These are the major changes to the script. Again, all credit goes to the creators of the script, All i did is modified it to my needs and hopefully it will serve any of you too.
For the sake of it, i renamed the script to Asynchronous image file upload without AJAX + PLUS so people will be able to distinguish between the two.
The script can be downloaded in the following link. Unfortunately i had to upload it to Rapidshare, if any of you is willing to host it on their servers, i'll be very thankful.
Till next time....


Download File

10 comments:

Žabák said...

Mate, I wrote this script only to show functionality, of course it was dirty work as all examples are. But thanks, I will propably publish your modification too.

I also have a highly modified version integrated with my private framework which is much more better. But release complex code is not the best idea how to show something easy.

Blond R said...

Well Mate, first of, thanks for your reply.
I don't think that i changed the complexity of the script by far, including a conversion class shouldn't make it any harder.
You did a really good job with this script, and you definitely proved the concept. I just thought that adding those simple modifications could save others precious time :)

crystal sexylingerie said...

Article is very interesting,thanks for your sharing. I will necessarily add it in the selected works and I will visit this site.


plastic machinery
plastic recycling
Granulator
Extruder
Twin Screw Extruder
Extruder machine
Pipe Extrusion System
Profile Extrusion System
WPC Production line
Plastic Auxiliary Machine
Extruder machine
Pallet racking
Racking system
Racking
Pallet rack
Flow racking
Cantilever racking
Light duty rack
Mezzanine rack
Flow Racking
Racking accessories
Racking manufacturer

crystal sexylingerie said...

subject:Led sign,Illuminated Signs,light box and neon sign manufacturer

Article is very interesting,thanks for your sharing. I will necessarily add it in the selected

works and I will visit this site.

Led sign
Illuminated Signs
light box
neon sign
China neon sign
Solar Light Box
Led displays
Solar Gas Sign
Neon sign manufacturer
Solar Light Box
artificial grass
synthetic grass
Aritficial Grass for Landscaping
Fake Grass
Artificial Grass for Sport
Economical Grass for Landscaping
Fibrillated Grass for Sport
Monofilament Grass for Landscaping
Monofilament Grass for Sport

crystal sexylingerie said...

I have read your article.Article is very interesting,thanks for your sharing. I will necessarily add it in the selected works and I will visit this site.

Welcome to my website:

x-ray machine
hospital bed
Autoclave
dental chair
Dental Unit
Infant Incubator
Operating Lamp
Laboratory Centrifuge
Powder Coating
powder paint
Polyester Epoxy Powder Coating
Epoxy Powder Coating
China powder coating
Polyester Powder Coating
Epoxy Powder Coating
Decorative Powder Coating
Pearl Powder Coating
Metallic Powder Coating
Heat Transfer Printing Powder Coating
Heat Transfer Printing Paper
Clear Powder Coating
Transparent Powder Coating
Polyurethane Powder Coating
Acrylic Powder Coating

Shirley said...

I think all of your airticles are based on smart ideas, and obviously a reward of your hard work, keep working, you have my support...
Travel to Beijing

CJ said...

Good article. Look also php form.

贤重 said...

One summer afternoon, Former President Bill Clinton and his wife Hillary were vacationing in their home state of Arkansas. Jimmy Choo handbags After a long road trip, they stopped at a service station to fill up their car with gas.A blind man, with a seeing eye dog at his side, walks into his local grocery store.Miumiu handbags He walks to the middle of the store, picks up the dog by the tail, and starts swinging the dog around in circles over his head.Mulberry handbagsAn ambitious young blonde woman, in need of money, decided to hire herself out as a handyman-type. She began, door to door, canvassing a wealthy neighborhood for work. She went to the front door of the first house and asked the owner if he had any jobs for her to do.

Ana said...

Interesting... I was searching this info for my uncle. He will be happy for such a great info. Thanks for sharing...
Ana
Artificial Grass

pokershark103 said...

car and auto insurance