Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Professional Ajax ISBN: 978-0-471-77778-6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Ajax ISBN: 978-0-471-77778-6
This is the forum to discuss the Wrox book Professional Ajax by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780471777786
Important: For the new 2nd edition of this book, please post here instead: [url="http://p2p.wrox.com/forum.asp?FORUM_ID=307"]http://p2p.wrox.com/forum.asp?FORUM_ID=307[/url]
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax ISBN: 978-0-471-77778-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 27th, 2006, 07:56 PM
Registered User
 
Join Date: Mar 2006
Location: Coronado, CA, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Http file or stream post via JavaScript...

Hi -

Throughout the book most input types are hidden/text, is it possible to pass an input object with type "file" to a server via JavaScript? I know it is not possible to write/edit/copy(?) file inputs for security reasons, but is it possible to build and submit a form "enctype=multipart/form-data" in order to get the file array populated for a web service to digest? Such as in "sendRequest()" on page 42?

I am writing a file upload web utility in .NET and would like to asynchronously upload a few files (or file byte streams?) and use some AJAX techniques to track the upload status.

Great AJAX book! Easy to read and follow. Maybe my question is covered in another Wrox book?

Thanks for any information,
- Joe

Reply With Quote
  #2 (permalink)  
Old March 27th, 2006, 08:17 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Joe,

You can't upload a file using XMLHttp since you have no access to the file data (other than the name) via JavaScript.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
  #3 (permalink)  
Old May 2nd, 2006, 07:30 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm interested in this problem also. I'm writing a webmail system that encrypts messages using a Java applet. I'd like to be able to encrypt file uploads also but there doesn't seem to be any way to get access to the file data. Is there another technology that would make this possible?


Reply With Quote
  #4 (permalink)  
Old May 2nd, 2006, 07:39 PM
Registered User
 
Join Date: Mar 2006
Location: Coronado, CA, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Gmail has somehow passed a file input to another async thread to upload the file while you are composing your mail message. I have not figured out exactly how they've done it, yet.

Reply With Quote
  #5 (permalink)  
Old May 2nd, 2006, 09:07 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You would have to use either an ActiveX control or Java applet with a custom upload mechanism to attempt such a thing.

As for Gmail's system, they aren't submitting the file via XMLHttp, they are actually submitting the file to a hidden frame.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.net http post with file Master .NET Framework 1.x 0 November 20th, 2008 09:21 AM
HTTP post silver_scar C# 2005 0 July 31st, 2006 09:52 AM
HTTP POST/GET d_alchemist JSP Basics 1 April 24th, 2006 09:18 AM
XML HTTP Post acdsky Servlets 2 June 2nd, 2005 10:59 AM
HTTP-POST with C# jcascio ASP.NET 1.0 and 1.1 Professional 3 April 12th, 2004 01:15 PM



All times are GMT -4. The time now is 02:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.