Re: Content-type for Binary File

new topic     » goto parent     » topic index » view thread      » older message » newer message

On 21 Oct 2004, at 14:11, cklester wrote:

> 
> 
> posted by: cklester <cklester at yahoo.com>
> 
> Kat wrote:
> > On 21 Oct 2004, at 13:33, cklester wrote:
> > > posted by: cklester <cklester at yahoo.com>
> > > How would I transfer a file via HTTP using mic's URLMON?
> > > Right now I can do this:
> > >    if get_file({"library.esp?getlist","library.esp"}) then
> > >       if get_file({"getform.esp?rrc_p-1.dot","rrc_p-1.dot"}) then end if
> > >    end if
> > > get_file takes a URL (which is also the filename) -or- a URL and filename
> > > (like above) and saves the download result into the filename. For the
> > > library.esp?getlist URL above, it works fine. But for the .DOT file (which
> > > is a Microsoft Word template), it cuts out at about 28kb, even though the
> > > file is about 400kb. I'm sure it's because I'm using "Content-type:
> > > text/plain;," but I don't know what to use.
> > Use  *.* , but i don't think that's the problem. Not all servers care about
> > what content type you say you can accept, and if it did care then it
> > wouldn't
> > send you the first 28K of it.
> 
> Kat, I tried using *.* as Content-type, but that still only gave me
> 27K or so.
> 
> Here's the code on the server that is sending the file... Maybe this needs
> to be modified... (typed in, not copied)...
> 
> }}}
<eucode>
> fn = open("c:\\templates\\" & form2send,"rb")
> if fn > 0 then
>    puts(1,"Content-type: *.*;\n\n")

Why the semicolon there? If you have multiple types, they are to be 
separated by a comma, and there is no semicolon or comma at the end. But 
i don't know if that is the bug or not.

If possible, i would try to not read a byte at a time, maybe use one of 
Euman's winapi tricks to move chunks of the file into memory and feed it out 
from there. Since his way is outside Euphoria, the used memory is 
reclaimable by the OS. Of course, if you use nix, i don't know.

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu