Getting the name & extension of an uploaded file using python (google app engine) -
After
I am using a form to upload Google App Engine files and store them in databases. L also want to store the extension for the original file name and presentation purposes.
Is there a way of retrieving this data from Post Sever or is it just gathering the client's side and (can be sent as separate fields? For example )
Many thanks
Follow the solutions that are dased on the answer below:
this_file = Self.request.params ["file_upload_form_field_name"] filename (this_file_name, this_file_extension) = os.path.splitext (this_file) self.response.out.write ("file name:" + this_file_name + ""
; ") Self.response.out.write (" File Extension: "+ + this_file_extension +"
")
work snippet
self.request.params? [& Lt; File & gt; form element name;] File name
Comments
Post a Comment