11, October 2008

Using XMLHttpRequest to upload images without refresh - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: Using XMLHttpRequest to upload images without refresh
« previous next »
Pages: [1] Print

Author Topic: Using XMLHttpRequest to upload images without refresh  (Read 959 times)
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« on: Oct 02, 2007, 09:53:46 AM »

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.
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8116
41653 credits
Members referred : 3



« Reply #1 on: Oct 02, 2007, 10:07:50 AM »

Hi apple2 and welcome to webdigity Smiley

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

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Oct 02, 2007, 12:06:56 PM »

Hi apple2 and welcome to webdigity Smiley

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)


Last blog : Upload images for usage in TinyMCE
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« Reply #3 on: Oct 02, 2007, 05:24:56 PM »

Hi apple2 and welcome to webdigity Smiley
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.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Oct 02, 2007, 05:49:04 PM »

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
« Last Edit: Oct 02, 2007, 05:50:41 PM by Olaf »


Last blog : Upload images for usage in TinyMCE
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« Reply #5 on: Oct 03, 2007, 06:02:47 AM »

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 Smiley

http://www.webdigity.com/index.php/topic,7181.0.Attachment+research+log.html Visit through proxy
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


XMLHttpRequest to upload images?
« Reply #6 on: Oct 10, 2007, 06:34:41 AM »

Do you think it can? I'm still not sure and resorting to an Iframe attachment model at this point.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Oct 10, 2007, 07:58:47 AM »

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...


Last blog : Upload images for usage in TinyMCE
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7178
Tags : forum attach without refresh Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  JavaScript
Topic: Using XMLHttpRequest to upload images without refresh
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct 11, 2008, 09:04:31 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.905
Total Topics: 7.557
Total Members: 4.150
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: neli67

32 Guests, 4 Users online :

12 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.