Send a file - http - Mozilla

This is a discussion on Send a file - http - Mozilla ; Hello everyone, I am trying to develop an extension that sends a file to a remote server->(running apache+mod_python). How can this be done? Regards, Gil...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Send a file - http

  1. Send a file - http

    Hello everyone,

    I am trying to develop an extension that sends a file to a remote
    server->(running apache+mod_python).
    How can this be done?


    Regards,
    Gil

  2. Re: Send a file - http

    On 10.10.2008 02:57, Gil Binder wrote:
    > Hello everyone,
    >
    > I am trying to develop an extension that sends a file to a remote
    > server->(running apache+mod_python).
    > How can this be done?
    >
    >
    > Regards,
    > Gil


    Have a look at nsIUploadChannel if you plan to deal with "large"
    uploads. (Those regular HTTP channels implement that
    interface/functionality).
    http://mxr.mozilla.org/seamonkey/sou...oadChannel.idl
    http://mxr.mozilla.org/seamonkey/sou...ileStreams.idl

    See the HTTP and MIME specs on how to send the data in a format your app
    may understand.
    If you need to send some string data and some data retrieved from a file
    combined (like it is with multipart/form-data) have a look at
    nsIMultiplexInputStream too.
    http://mxr.mozilla.org/seamonkey/sou...nputStream.idl

    The critical parts for multipart/form-data file submissions are located
    here btw:
    http://mxr.mozilla.org/seamonkey/sou...ission.cpp#777

    If it is just some "small" files then you might use
    XMLHttpRequest.send(data) (this will internally use nsIUploadChannel
    anyway).
    You may also manipulate the XMLHttpRequest channel yourself (should
    support things like e.g.
    nsIHttpChannel/nsIUploadChannel/nsIResumableChannel).
    http://mxr.mozilla.org/seamonkey/sou...ttpRequest.idl

    Cheers
    Nils

+ Reply to Thread