How to upload a file using the BlobStore in Python App Engine? -


I specified anything in app engine documents but I could not work on the blockbuster. Perhaps some of you can find out what I am doing wrong.

http: // localhost: 8080 / when I click on submit button

This type of URL is seen in the address bar and an empty white page is in front of me. _ah / upload / agltb2JpbHNvcnVyGwsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxg9DA

Anyone have a suggestion

These are my handlers:

  class MainHandler (webapp.RequestHandler ): Get DEF (self): year = year Hours (). Order ("year") months = months. all (). ("SortNumber") upload_url = blobstore.create_upload_url ('/ imidergi / upload') content = {'upload': upload_url, 'yearList': year, 'monthList': month,} render_template (auto, 'imidergi.html' Content) Category AddDergi (blobstore_handlers.BlobstoreUploadHandler): def post (auto): File upload field as # 'file' is upload_files = self.get_uploads ('file') blob_info = upload_files [0] dergi = Dergiler () dergi Year = self.request.get ("Yil") dergi.Month = self.request.get ("ay") dergi.DergiPDF = str (blob_info.key ()) dergi.Name = self.request.get ("isim ") Dergi.Image = self.request.get (" resim ") dergi.put () self.response.out.write (dergi.Name)   

and this html which is rende Form form.

  & amp; Form form = "{{upload}}" method = "post" id = "diriform" enctype = "multipart / form-data" & gt; {{Upload}} & lt; Label & gt; Yil: & lt; / Labels & gt; & Lt; Select name = "yil" & gt; In {% Year Year List}% & lt; Option value = "{{year.Year}}" & gt; {{Year.Year}} & lt; / Options & gt; {% Endfor%} & lt; / Select & gt; & Lt; Br / & gt; & Lt; Label & gt; Age: & lt; / Labels & gt; & Lt; Select name = "A" & gt; {% Month Month%} & lt; Option value = "{{month.Name}}" & gt; {{Month.Name}} & lt; / Options & gt; {% Endfor%} & lt; / Select & gt; & Lt; Br / & gt; & Lt; Label & gt; Ischem: & lt; / Labels & gt; & Lt; Input type = 'text' id = "isim" name = "isim" /> gt; & Lt; Br / & gt; & Lt; Label & gt; Dangerous: & lt; / Labels & gt; & Lt; Input type = 'file' id = "file" name = "file" /> gt; & Lt; Br / & gt; & Lt; Label & gt; Receipt: & lt; / Labels & gt; & Lt; Input type = 'file' id = "resim" name = "resim" /> gt; & Lt; Br / & gt; & Lt; Label & gt; & Lt; / Labels & gt; & Lt; Input type = 'submit' value = 'single' / & gt; & Lt; / Form & gt;  

IIRC blobstoreloadloader Special Boobstore responds to the upload server and redirects directly with a normal request such as a client / browser .

Copy the example from the docs, and remember that you can respond with only header (like redirects) and not with the body's content.

Comments