1. missing 13; upload script
- Posted by Salix <salix at freemail.hu> Sep 10, 2006
- 536 views
I'm struggling with an upload CGI script. (Again.) The problem is rather strange... I collect the input with get_bytes(0,i) but the returned sequence sometimes misses some 13 bytes from the file part. What is going on? Any idea? Thanks in advance! Salix
2. Re: missing 13; upload script
- Posted by Robert Craig <rds at RapidEuphoria.com> Sep 10, 2006
- 531 views
Salix wrote: > I'm struggling with an upload CGI script. (Again.) > > The problem is rather strange... I collect the input with get_bytes(0,i) but > the returned sequence sometimes misses some 13 bytes from the file part. What > is going on? Any idea? Be careful to upload binary files using the BINARY option (not ASCII) in your FTP program. Otherwise you might have 13 10 (i.e. CR LF) character combinations converted to just a 10. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com
3. Re: missing 13; upload script
- Posted by Salix <salix at freemail.hu> Sep 10, 2006
- 521 views
Actually I'm experimenting with HTTP. The upload is started with a multipart/form-data HTML FORM. I tested it with Opera and Abyss webserver. I parse the input but does not replace {13,10} with {10} but it simply skips 13 sometimes. (But not all 13 bytes!) Eg. some sequence parts:
s1[i1..i2]={10,12,20,13,12,11,11} s2[i1..i2]={10,12,20,12,11,11,12}
The way I found this problem was comparing the original and the uploaded JPG byte by byte. I am clueless. Should be something really obvious... Regards, Salix Robert Craig wrote: > > Salix wrote: > > I'm struggling with an upload CGI script. (Again.) > > > > The problem is rather strange... I collect the input with get_bytes(0,i) but > > the returned sequence sometimes misses some 13 bytes from the file part. > > What > > is going on? Any idea? > > Be careful to upload binary files using the BINARY option (not ASCII) > in your FTP program. Otherwise you might have 13 10 (i.e. CR LF) > character combinations converted to just a 10. > > Regards, > Rob Craig > Rapid Deployment Software > <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>
4. Re: missing 13; upload script
- Posted by don cole <doncole at pacbell.net> Sep 10, 2006
- 531 views
From get_bytes notes: include get.e integer fn fn = open("temp", "rb") -- an existing file sequence whole_file whole_file = {} sequence chunk while 1 do chunk = get_bytes(fn, 100) -- read 100 bytes at a time whole_file &= chunk -- chunk might be empty, that's ok if length(chunk) < 100 then exit end if end while close(fn) ? length(whole_file) -- should match DIR size of "temp" Does this happen ? size match I mean. Don Cole
5. Re: missing 13; upload script
- Posted by Salix <salix at freemail.hu> Sep 10, 2006
- 542 views
- Last edited Sep 11, 2006
As far as I see your code has not much to do with my problem. In my case a file uploaded by an HTML FORM and saved by an EU CGI script running under windows differs from the original binary file. Your code can check a file read by get_byte and saved by a local EU script to the original binary file. My problem may come from the unique STDIN handleing in Euphoria. But I am not sure at all. {:-. Salix don cole wrote: > > From get_bytes notes: > > [...] > Does this happen ? size match I mean. > Don Cole