Just joined the list; be gentle with me! How do I reference a ZPublisher.HTTPRequest.FileUpload instance? I can see the content type and content length with REQUEST, so I know the file is there. I also know that the FileUpload instance is a Python file-like object. That's what I want because I want to read it. But, how do I get to the thing? Is it part of the REQUEST object? I've tried using a script and an external method but no luck. Thanks folks, Bill
Just joined the list; be gentle with me!
How do I reference a ZPublisher.HTTPRequest.FileUpload instance?
I can see the content type and content length with REQUEST, so I know the file is there. I also know that the FileUpload instance is a Python file-like object. That's what I want because I want to read it. But, how do I get to the thing? Is it part of the REQUEST object?
I've tried using a script and an external method but no luck.
Don't overthink it. It's just like you'd access any request parameter, save that it's a Python file-ish object. Say you did:: <form method="post" action="blerg"> <input type="file" name="somefile" /> <input type="text" name="sometext" /> <input type="submit" /> </form> Then in 'blerg' (a Python script) you could say:: fileobj = REQUEST.somefile stringobj = REQUEST.sometext to get a handle on the parameters. (Or any of the other ways the REQUEST object allows access to request parameters.) The only difference is that one is a string and one is a FileUpload file-ish object. --jcc
participants (2)
-
Bill Tolbert -
J Cameron Cooper