Hi Robert,

Thank you for your advices. I did not checked my logs before you
said.

When I checked my logs, it gives:

    w=upload_files[0]
IndexError: list index out of range
INFO     2011-02-13 07:17:39,486 dev_appserver_blobstore.py:328]
Upload handler returned 500
ERROR    2011-02-13 07:17:39,486 dev_appserver_blobstore.py:341]
Invalid upload handler response. Only 301, 302 and 303 statuses are
permitted and it may not have a content body.
INFO     2011-02-13 07:17:39,509 dev_appserver.py:3317] "POST /_ah/
upload/agZlcGN2ZGJyHAsSFV9fQmxvYlVwbG9hZFNlc3Npb25fXxi_Agw HTTP/1.1"
500 -

As I understand from it, It could not get the file so it gives list
index out of range error. However, in another application I use the
same structure and it does not give any error.

Any suggestion about that?

On Feb 13, 6:38 am, Robert Kluin <[email protected]> wrote:
> Some thoughts / suggestions:
>   1) Check your url to handler mappings. Both in app.yaml and in your
> WSGI app definition.
>   2) Check the logs to see what urls are actually getting hit.
>   3) At some point in the Upload handler you do create and put a new
> Expert entity, right?
>
> Robert
>
>
>
>
>
>
>
> On Sat, Feb 12, 2011 at 06:41, theone <[email protected]> wrote:
> > Hello,
>
> > I want to keep user information and files with blobstore but I could
> > not do it.
> > I have a structure like:
>
> > class Expert(db.Model):
> >        N = db.StringProperty(indexed=True, required=True,
> > verbose_name='Name')
> >        S = db.StringProperty(indexed=True, required=True,
> > verbose_name='Surname')
> >        BD = db.DateProperty(indexed=True, required=True, verbose_name='Birth
> > Date')
> >        EY = db.IntegerProperty(indexed=True, verbose_name='Years of
> > Experience')
>
> > class AddExpert(webapp.RequestHandler):
> >                upload_url = blobstore.create_upload_url('/upload')
> >                doRender(self, "addexpert.htm", {'upload_url': upload_url } )
>
> > and html form like:
>
> > <form id="upload_form" action="{{ upload_url }}" enctype="multipart/
> > form-data" method="post">
> > <table>
> >  <tr><td class="leftcolumn">Name</td><td><input type="text"
> > name="name" /></td></tr>
> >  <tr><td class="leftcolumn">Surname</td><td><input type="text"
> > name="surname" /></td></tr>
> > ....
>
> > when I tried to upload my data and redirect my page:
>
> > class Upload(blobstore_handlers.BlobstoreUploadHandler):
> >    def post(self):
> >        upload_files = self.get_uploads('file')
> >        blob_info = upload_files[0]
> >        blob = blob_info.key()
> >        N = self.request.get('name')
> >        S = self.request.get('surname')
> >        ......
> >        self.redirect('/')
>
> > It redirects to an empty page. It saves the file at __BlobInfo__ (I
> > could see it at SDK console) but it does not save other information.
>
> > Am I missing any point?
> > Thanks for helps in advance.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to