I am very confused by this. I cannot find any change that could cause this 
change of behavior. Let me summarize to make sure I am understanding.

You observed a change of behavior between 2.21.1 and 2.22 1.
The change of behavior only manifests when you declare a default app in 
routers.py
The change of behavior consists of the fact that, if you upload a file 
using a form, the link to download the file does not work.
You can confirm that the file is there and the link works if no default app 
in routers is provided.

Is this all correct? If yes. I will debug more. If you could provide a 
minimalist app to reproduce it would save me some time.

Massimo



On Wednesday, 9 February 2022 at 07:21:40 UTC-8 cdbaron wrote:

> Now from github I can successfully download web2py.
>
> But I have a problem with a form with a field of type upload.
>
> With web2py 2.21.1 it works fine, but with version 2.22.1 it doesn't work. 
> I have tested with python 3.7 and 3.8
>
> I already posted a query a few days ago, but I haven't had any response, I 
> apologize for posting the same thing again.
>
> When I upload any image with a form, for example the one below, when 
> downloading the image I get a 400 bad request error
>
> def upload_img():
>     record = db(db.t_upload).select().first()
>     form = SQLFORM(
>         db.t_upload,
>         record,
>         upload=URL('default', 'download')
>     )
>
>
> I think it is some modification in web2py after publishing version 2.21.1
>
> I have tried to attach a .w2p file with the myapp application but it does 
> not allow me to upload this type of file.
>
> The application works perfectly if I do NOT use a routes.py file in the 
> web2py root directory.
>
> http://127.0.0.1:8000/myapp/upload/upload_img (Works fine)
>
> But with the file routers.py with this content:
>
> routers = dict(
>     BASE=dict(
>         default_application='myapp',
>     ),
> )
>
> The application does not work well, there is a 400 error when downloading 
> the
> image uploaded with the form
>
> http://127.0.0.1:8000/upload/upload_img (Doesn't work right)
>
> This 400 error also occurs whenever the image is used, not just on the 
> form.
>
> I am doing something wrong?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0aa0159d-2403-490b-8d40-f14f495e650cn%40googlegroups.com.

Reply via email to