Sponsored by HTC
You and You and You. view!
youtube.com - You don't need to get a phone. You need a phone that gets you.
60 Comments
- sneed, on 11/12/2007, -1/+9Hasn't anyone noticed that the title of the page is "Asynchronous image file upload WITHOUT AJAX"?
- Krule, on 10/12/2007, -1/+4*Asynchronous Javascript and XML (Sorry)
- hotwaterham, on 10/12/2007, -0/+3This is SO ajax! I'll take three!
- jeremy2, on 10/12/2007, -0/+2You might want to take a look at my implementation: http://www.seemysites.net/projFolder/uploader . Comments and suggestions are always welcome in the forum.
- SilverRocket, on 10/12/2007, -0/+2Gmail actually does this. Compose a message, add an attachment, but don't submit/send your email for a few minutes. Check out the screen - it's saved a draft AND your attachment. Creepy!!
- technel, on 10/12/2007, -0/+1Just look at the website title -- "Asynchronus image file upload WITHOUT Ajax". Now look at the Digg title -- "Use Ajax To Upload Files".
- isilex, on 10/12/2007, -0/+1I don't like it to force an upload after I select a file -- what if I select the wrong file by mistake.
Good work with using iframes -- but not really ajax -- but needs to be refined. - secureirc, on 10/12/2007, -0/+1If anybody would like the file that cryptoknight was talking about at https://files.secureirc.org/ you can download a .rar file here: http://www.secureirc.org/files/files.rar
- boardo, on 10/12/2007, -0/+1seems like anything that is written with javascript with a little xml functionality is just dubbed ajax, im not necessarily relating it to this exact article, just that title seems overused to say the least.
just like web 2.0 - lukes, on 10/12/2007, -0/+1there an AJAX uploader for ruby on rails, http://sean.treadway.info/demo/upload/, which has a progress bar indicator. there's a how to movie here http://sean.treadway.info/articles/2005/04/18/upload-progress-live-demo-plus-movie
- tagawa, on 10/12/2007, -0/+1With every AJAX story, why do we need to continually have these arguments as to the exact definition of AJAX? Isn't that what Wikipedia is for?
The time spent typing the 'can use an iframe', 'cannot use an iframe' comments could surely be put to better use by discussing the good and bad points of the story in question and how the related code can be improved.
Sorry to moan but stories like this are ultimately here to learn from and use as inspiration. A programmer's goal should be a happy user, not winning an acronym contest.
Now that's off my chest, let the flaming begin... - libregeek, on 10/25/2007, -0/+1Got an javascript error in Firefox-1.5: and here is the fix:
Line #53 in upload.php use the above line
setTimeout('document.iform.submit()',5000);
instead of this:
setTimeout(document.iform.submit(),5000); - caldroun, on 10/12/2007, -0/+1I like google's gmail upload. Before I have even finished typing the message it started uploading the file if I selected it first of source.
- MurrayFox, on 10/12/2007, -1/+1Everytime someone writes a piece of ajax it ends up on digg... If uploading files were something you hadn't been able to do since the dawn of time it might be interesting, but this is nothing new.
Lame. - isilex, on 10/12/2007, -0/+0@caldroun: that is definitely neat ..
- idris, on 10/12/2007, -0/+0more Ajax buzz...
There are more useless Ajax stories on Digg than there are Google stories on slashdot. - ext237, on 10/12/2007, -0/+0"this falls firmly under the umbrella."
Exactly. XMLHttpRequest Object is not a requirement for Ajax -- there are Ajax frameworks which degrade into iframe subset if the browser doesn't support asynk, or the user has it disabled. - phildog, on 10/12/2007, -0/+0no progress bar = no digg
- shockingbird, on 10/12/2007, -0/+0Pretty slick. Got it working on my site. Simple and straightforward.
- rchtr, on 10/12/2007, -0/+0My company still insists on supporting OS9/MSIE (which doesn't support XMLHttpRequest), so we have to use iframes as a work-around. We still call it AJAX, mostly because it's not worth describing the subtle "backend" differences to non-techies.
Either way, pretty neat. - bloodroot, on 10/12/2007, -0/+0We've been "not using ajax" to upload files asynchronously in rails for 6 months, with a progress bar!
- _jinx_, on 10/12/2007, -0/+0Well if you want me to define Ajax for you allow me to do so:
Wikipedia
"The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in some situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server."
Not always is the XMLHttpRequest Object used, so in reality the title of the header is wrong. If you actually read the code you would understand the title. If the application speaks asynchronusly to the server it is AJAX! - ext237, on 10/12/2007, -0/+0also, see http://www.ajaxian.com regarding the use of iframes as a legal construct within any Ajax implementation. its all there.
- _jinx_, on 10/12/2007, -0/+0@gunbuster
Yes, that video can been seen here: http://mir.aculo.us/articles/2005/04/10/upload-progress-with-ruby-on-rails-and-ajax-demo-movie
However, there are negatives to RoR like auto templ building and a lot of overhead on simple projects. Anyways, i found this to be very useful. - _jinx_, on 10/12/2007, -0/+0The reason I stated in the title it is using ajax because it is considered "Asynchronous". Anyway's its fairly fast, and I am sure there will be new methods soon that will allow this.
- dotnetdeveloper, on 10/12/2007, -1/+1This is not AJAX
- Robotsu, on 10/12/2007, -0/+0Just to point out, there is actually a specific Microsoft Activex object that has "Stream" support, esentially creating "AJAX"-ian file uploading. But of course, that's not cross-platform..
- Krule, on 10/12/2007, -1/+1boardo: You've just about got it, it's actually anything that is written with javascript with any xml functionality that works asynchronously. Asynchronous Java and XML.... AJAX :-)
- geminitojanus, on 10/26/2007, -1/+1"cheating"?? using an iframe is about the only asychronous way to do it (javascript doesn't have the facilities to deal with file reading, else it could be done with "AJAX". And because the XMLHTTPRequest object *isn't* required to make something "AJAX", this falls firmly under the umbrella.
Dugg for spreading the word (I wrote something very similar for my own consumption). - crispytown, on 10/12/2007, -1/+1So as most of you have said. If there is an iframe then it isn't AJAX. That is wrong. Google Maps uses an iframe to run its ajax search system. Read any AJAX book and you will see they say useing an iframe is one way to control the flow of data.
- Squeegy, on 10/12/2007, -1/+1kinda cheating with the use of an iframe. This is not a file upload via AJAX. Once the file is uploaded though, it is displayed on the page via ajax.
Sadly we still don't seem to have a way to upload files via AJAX. - yonah, on 10/12/2007, -0/+0THe source says that this isn't AJAX, so the digg-post is wrong. That's lolish. No digg.
- MacGyver, on 10/12/2007, -0/+0thanks for the link lukes, been looking for something like this for a long time.
- developerpk, on 10/12/2007, -0/+0Dear Bro,
Its working fi9 for me but one problem is if i want 2 change the upload pic could it change?And i also want if the wrong file is selected for uploading it displays an error.I also want to fix the size of pic not more than 500kb and there are two button one is 'browse' and other is 'change'.I m not an expert programmer.I just know html.If u can do this i will be gr8ful to u.mail me the code on developerpk@gmail.com - jammydevil, on 10/12/2007, -0/+0Cryptoknight:- Wouldn't mind looking at the source code for https://files.secureirc.org if you're still offering?
- _jinx_, on 10/12/2007, -0/+0What's even funnier is that every source that defines AJAX includes the method they use, but I guess they are wrong as well. Now that is lolish, comment++
- inactive, on 10/12/2007, -0/+0Poop tech demo, not news.
- etx313, on 10/12/2007, -0/+0Now if it could only clean my toilet.... hmmmm..
- Bloodwine, on 10/12/2007, -0/+0lack of progress bar is PHP's fault. There is no solution for a progress bar in PHP unless you use a Perl CGI script as a man-in-the-middle (e.g.: MegaUpload). It's a hack, though.
The only other way is to monitor the temporary upload file size. of course you don't know the total size and you are screwed if there are multiple uploads occuring.
It seems such a small thing, but I don't see PHP fixing it anytime soon for some odd reason. Progress bar is really something needed I think. Other languages can do it. - mkarakas0690, on 11/19/2009, -0/+0http://www.yukle.in
- mcmoisei, on 10/12/2007, -0/+0Technically seems to be impossible to use pure Ajax to do the job. However targeting the upload form against an i frame and combined with asynchronous calls to display the status is good enough.
Here's a nice example!
http://sean.treadway.info/demo/upload/ - jeremy2, on 10/12/2007, -0/+0See my reply above for the implementation I wrote/modified. I plan on keeping it totally free, forever.
- an0n1m0us, on 10/12/2007, -0/+0If you don't like AJAX news, piss off, don't read it. Considering it's the most interesting thing to hit web development since standards-based design, many of us are very interested.
Personally I use Perl and just recently was looking for an AJAX uploader. There are not many out there. I thought I'd found something with FileChucker but the non-free factor is annoying. - rulezgetbent, on 10/12/2007, -0/+0Whatever! this script is great. I actually stumbled across this about 6 months to a year ago. I dont remember, but this works great, and looks clean.
- nosretep, on 01/16/2008, -0/+0I would use this, as it does solve a problem, however it's not technically ajax so I can't use it. I'm just going to have to dream about the millions of dollars I would make if only this solution, to my problem, were ajax.
- pagadala1, on 02/07/2008, -0/+0File uploading with AJAX is not available and, it will never come into picture, if AJAX supports file upload you have to give the file name as an input to the AJAX object from your HTML page, then it uploads by taking like textfield.value may be you thinking in that way, What happens you hardcode a System file in your AJAX code and upload to the server without user permission! Will that be bigsecurity flaw right:) So never think of AJAX file upload, even if AJAX provides file upload there should be an alert from AJAX Engine to take permission from the user to upload the file, this will very very annoying to the user, so we need not think about this now!
- developerpk, on 10/12/2007, -0/+0Dear Xperts,
Its working fi9 for me but one problem is if i want 2 change the upload pic could it change?And i also want if the wrong file is selected for uploading it displays an error.I also want to fix the size of pic not more than 500kb and there are two button one is 'browse' and other is 'change'.I m not an expert programmer.I just know html.If u can do this i will be gr8ful to u.mail me the code on developerpk@gmail.com -
Show 51 - 63 of 63 discussions



What is Digg?