• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Multiple File upload read
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple File upload read


  • Subject: Re: Multiple File upload read
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 5 Mar 2010 09:49:57 -0800


On Mar 5, 2010, at 9:27 AM, Fabián Montealegre Carvajal wrote:

Thanks for the advice. I have a new problem.

I am doing this:

 if (aContext.request().isMultipartFormData()){


WOMultipartIterator wmi = aContext.request().multipartIterator();
WOFormData data = wmi.nextFormData();

As a guess, you probably want

public InputStream formDataInputStream()


             while (data != null) {
                 if ( data.isStreamValid()) {
                     System.out.println(data.toString());

                     try {
                            NSData myFile = data.formData();

                           this.workWithTheFile(myFile);

                        } catch (IOException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }

                 }

                 data = wmi.nextFormData();
             }

//



The method "this.workWithTheFile(myFile)" used to work with WOFileUpload perfectly fine, but right now its throwing an error.

System.out.println(data.toString()) prints:
WOFormData 4 isStreamValid true headers: {content-disposition = ({form-data = <class com.webobjects.foundation.NSData (offset=0, length=9, data=[102]'f', [111]'o', [114]'r', [109]'m', [45]'-', [100]'d', [97]'a', [116]'t', [97]'a')>; filename = "myXMLFile.xml"; name = "File0"; }); content-type = ("text/xml"); }


The main problem is that "NSData myFile = data.formData()" is returning null. How should I handle the WOFormData to convert it into a valid NSData?

Thank you for your time.


-- Fabián Montealegre Carvajal

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects








_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Multiple File upload read
      • From: Fabián Montealegre Carvajal <email@hidden>
References: 
 >Re: Multiple File upload read (From: Fabián Montealegre Carvajal <email@hidden>)

  • Prev by Date: Re: Multiple File upload read
  • Next by Date: Re: Multiple File upload read
  • Previous by thread: Re: Multiple File upload read
  • Next by thread: Re: Multiple File upload read
  • Index(es):
    • Date
    • Thread