[Tutor] strange magic

Kirk Bailey idiot1 at netzero.net
Sun Aug 17 14:54:25 EDT 2003


ok, I got the thing feeding the file. Feeds the name, the fieldname, and the 
content of the file. The thing spews THIS at the receiving end:
('ware wordwrap...)
form= FieldStorage(None, 
None,[FieldStorage('userfile','AN_flaming_TinyList.gif', 
'GIF89a\211\0003\000\245\000\000\002\002\002\326\2726\225\020\006\202\010\003\273\2159\203&\015l\004\003\270@\027W\002\002\267\255\224C\002\002\263Y\032\2048\016\371\350#:\002\00266.bbR\344\332\257\352~)\211r\015\334\305\201\357\2310\212p\022\350\325@\244\'\015\332n&\372\366\307\212\210m4\002\002\365\272-\321Z\037\371\355k\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377!\377\013NETSCAPE2.0\003\001\000\000\000!\371\004\011\005\000 
\000,\000\000\000\000\211\0003\000\000\006\376@\220pH,\032\217H\004r\311l\032\225\316\250tJ\035\032\014\302\201\363p\250z\217\320\257x<\035h\267g\262z\315&\013\004\030L\372z\224H\332Q:~\257\216\023\257XC\002v\022\002|KZ\\]\207\214FZi\212]\213\200\202\203\025\025\206\215Eo\007~\232\237\177\221\006\010\007J\010\006f\211\002\227\025\240D\030\235\030\036\236\256{\251 
W\007\031\007\224(and much, much more; it's the data structure of an image file 
after all...)
ok, check this out.
	FieldStorage(...
ok, it says ther return is iteself an instance of FieldStorage.
	('userfile',
right, that's the name of the field in the form used to upload the thing.
	'AN_flaming_TinyList.gif'
right, that's the name of the file. How to ACCESS this stuff is puzzling. I am 
going to read the cgi module doc AGAIN, but any and all relevant comments would 
be well received.
	'GIF89a'....
  That's the start of the actual filedata.

To witness this chaos for yourself, visit
http://www.tinylist.org/testform.html
and click the browse button. Don't sweat, the program has a sys.exit in it long 
before the thing would save the file. Right now I am puzzling out the unpacking 
of the post method data into elements-and filename.

please advise.


-- 

-- 

end

Cheers!
         Kirk D Bailey

  +                              think                                +
   http://www.howlermonkey.net  +-----+        http://www.tinylist.org
   http://www.listville.net     | BOX |  http://www.sacredelectron.org
   Thou art free"-ERIS          +-----+     'Got a light?'-Promethieus
  +                              think                                +

Fnord.





More information about the Tutor mailing list