Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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

  #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/
  #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?


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

  #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/


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





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