Hi there,

I try to access post data from a form submitted. I have nsIInputStream
but I just can't call QueryInterface to get nsISeekableStream.  Please
let me know what I did wrong.  Code below:

nsCOMPtr<nsIUploadChannel> pUploadChannel =
do_QueryInterface(pHttpChannel);
if(pUploadChannel) {
      nsCOMPtr<nsIInputStream> pInputStream;
      pUploadChannel->GetUploadStream(getter_AddRefs(pInputStream));
      if(pInputStream) {
           nsCOMPtr<nsISeekableStream> pSeekableStream =
do_QueryInterface(pInputStream)
        if (pSeekableStream) {
              pSeekableStream->Seek(nsISeekableStream::NS_SEEK_SET, 0);
                      // it's never executed
         }
      }
}

I also try to call QueryInterface from nsIInputStream like:
pInputStream->QueryInterface(NS_GET_IID(nsISeekableStream),
getter_AddRefs(pSeekableStream));

But I get the same result.  What did I do wrong?
I call Available from pInputStream and the result is > 0.  I suppose
that I have pInputStream.

Thanks,
-Dark

_______________________________________________
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to