CGI / Binary Read

undo at cloud9.net undo at cloud9.net
Tue Feb 5 01:47:01 EST 2002


Yennie at aol.com wrote:
> 
> << If all else fails compress the file before uploading and decompress on
> the server.
> Make sure you get all the data over (same length before and after)!! >>
> 
> Unfortunately, my clients won't like that much =).
> The weird thing is, the $CONTENT_LENGTH is being reported as "48", and my
> graphic is certainly larger than that (I'm uploading JPEG files to be
> analyzed by the CGI). So, I'm getting the 48 bytes as reported, but that's
> it. Where's the rest? I'm running under Apache and Darwin...

But how do you upload them?

> 
> Here's my script in case anyone catches something...
> 
> #!mc
> on startup
>   set the shellCommand to "/bin/tcsh"
> 
>   put $CONTENT_LENGTH into theLength
>   put $CONTENT_TYPE into theType
>   put char (offset("boundary=",theType) + 9) to -1 of theType into theBoundary
> 
>   read from stdin until eof
>   put it into theArgs
> 
>   put "Length:"&theLength&"<BR>" after theText
>   put "Boundary:"&theBoundary&"<BR>" after theText
>   put "Args:"&theArgs after theText
> 
>   put "Content-Type: text/html"
>   put "Content-Length: "&length(theText)&cr&cr
>   put theText
> 
> end startup
> 
> Regards,
> Brian
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard

-- 
____________________
Regards, Andu Novac



More information about the metacard mailing list