Sublime directory Surf the web anonymous Pagerank Monitor


Using XMLHttpRequest to upload images without refresh

apple2
Tue 2 October 2007, 09:53 am GMT +0300
It looks like it is possible with setting the header and possibly encoding the image with jscript.
After a few hours my head just got fuzzier.

I'm trying to do it raw or without Ajax since it looks like Ajax uses those methods above anyway.
Please correct me if wrong of course.

req=new XMLHttpRequest or ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP");

params are the parameters to send a post this way.
params = 'var1=value1&var2=value2'

req.send(params)

But little is explained about images. if anyone knows please post as it is an alternative to hidden iframe
This saves some issues with the iframes php page to do it this way.

Nikolas
Tue 2 October 2007, 10:07 am GMT +0300
Hi apple2 and welcome to webdigity :)

Why don't you use a javascript library for AJAX (like scriptaculous or moo effects)?

olaf
Tue 2 October 2007, 12:06 pm GMT +0300
Hi apple2 and welcome to webdigity :)

Why don't you use a javascript library for AJAX (like scriptaculous or moo effects)?

because he need to use the post array (uploading files)

apple2
Tue 2 October 2007, 05:24 pm GMT +0300
Hi apple2 and welcome to webdigity :)
Why don't you use a javascript library for AJAX (like scriptaculous or moo effects)?

Thanks!

I'd like not to be dependent on a library which is simply using browser languages because I'd be including functions I do not understand and would be programming without a transparant view of what is going on. By coding from the ground up I'm expecting not to need libraries for much except things which are a real pain with browser compatability.

Please correct my mentality where wrong. I've coded from 1983 to about 2002 lots then 2003 till now ran a company and just did enough php/web/jscript to get by.

When I hear to use Ajax and try to use Ajax I haven't gotten anywhere.
If I download Ajax then there is a big library.

Should I be doing it with Ajax then pick apart the code used to optimize?
It sure seems more right to understand the code the guys used who wrote Ajax.
Am I going about this backwards? Again when I try to go the Ajax route I'm not aware of how to use the functions and am stuck not only learning commands but someones library.

olaf
Tue 2 October 2007, 05:49 pm GMT +0300
I used only XAJAX in the past (yeah its based on some javascript lib) check this thread
http://community.xajaxproject.org/viewtopic.php?pid=15363 Visit through proxy

here is another example for uploading a file with xajax:
http://wiki.xajaxproject.org/Xajax_0.2:_Tips_and_Tricks:_File_Upload_in_0.2.4 Visit through proxy

apple2
Wed 3 October 2007, 06:02 am GMT +0300
The Ajax sites are great links thanks!
I need to speed up to understand them or go through them without feeling intimidated.
Also the sites I pulled up on xhttp looked a bit like you can post an image with it!
For my current needs an Iframe will do but adding the ability to do it without one makes coding easier.

Here is a link to a thread starting with basic iframe attachments that will cover more fancy attachments.
Thats how I get re-warmed up to hard core coding then I'll come back here and rip apart the xhttp objects, dom or whatever once I see document.write in my nightmares.
Should be 4 days :)

http://www.webdigity.com/index.php/topic,7181.0.Attachment+research+log.html Visit through proxy

apple2
Wed 10 October 2007, 06:34 am GMT +0300
Do you think it can? I'm still not sure and resorting to an Iframe attachment model at this point.

olaf
Wed 10 October 2007, 07:58 am GMT +0300
Do you think it can? I'm still not sure and resorting to an Iframe attachment model at this point.

I thought you posted a solution to the other thread...

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional