No one ? Is my message too long to read ? :D On 19 juil, 23:43, "David D." <[email protected]> wrote: > I tried to add an upload field in one my form, using Google Blobstore > API. > But it's not as mush easy that I thought! The Google example works > well but... > > In my case, before using Blobstore (users didn't need to upload photos > before): > - I had an addItem.jsp file which contains a form with several fields. > - I had an addItemActionServlet which was called when the user > submitted the form. > - If there was an error (like an empty field), users were redirected > on the same page to correct the form to submit. If everything wa > allright, users were redirected in another page. > (For both cases, I had to set attributes to my request, and so, I had > to use the Forward method to redirect). > > Then, I added an upload field sothat users can upload photo on the > same page they fill the other fields. > I was forced to change the action, by calling the createUploadUrl() > method...ok. > > Now here is the problem: Google seems to want that I use > SendRedirect() method only, not Forward(). > Indeed, with the forward() method, i get : > - this error message on my page: "HTTP ERROR 500 - Expected a > redirect, tried to write content instead." > - this error on my Eclipse console: "GRAVE: Must only return a > redirect from a Blobstore upload callback." But my form is designed to > transfer lots of things between page. > > Should I design my form error handling in a different manner? It would > be a big pain because there is lots of stuff! I would prefere that you > give me an intelligent tip :) > > More, my code seems to be dirty because I'm calling the blobstore > service directly from addItem.jsp, and the form action always creates > an uploadURL, but it's possible that a user just would like to addItem > without uploading any photo on it!!! > > So, have you got an idea to solve this problem or to proceed > differently? > Thanks a lot.
-- 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.
