if any ( ['.jpg' in file_name, '.JPG' in file_name ,  ....]  ):
?

суббота, 22 июня 2019 г., 11:18:42 UTC+3 пользователь Константин Комков 
написал:
>
> I made upload form for files that winter and today when project is working 
> 3 days user told me that he can't load file. When I saw that file it name 
> was "name.JPG"  but in my code befor i find only .jpg. Now all is ok.
>     for i in img:
>         s = i.file[len(i.file)-5:len(i.file)]
>         if ((s.find('.jpg')>-1) | (s.find('.JPG')>-1) | 
> (s.find('.jpeg')>-1) | (s.find('.JPEG')>-1) | (s.find('.png')>-1) | 
> (s.find('.PNG')>-1) | (s.find('.bmp')>-1) | (s.find('.BMP')>-1)):
>             studDocs = studDocs + """<div id='doc"""+str(i.id)+"""' 
> class="col col-pd"><div class="img-box"><img class="img" 
> src='"""+URL('bak','download',args=i.file)+"""'/><div 
> class='del-img'></div></div></div>"""
>         elif ((s.find('.pdf')>-1) | (s.find('.PDF')>-1)):
>             studDocs = studDocs + """<div id='doc"""+str(i.id)+"""' 
> class="col col-pd"><div class="document"><p class="text-center 
> expansion">.pdf</p><div class='del-img'></div></div></div>"""
>         elif ((s.find('.tif')>-1) | (s.find('.TIF')>-1)):
>             studDocs = studDocs + """<div id='doc"""+str(i.id)+"""' 
> class="col col-pd"><div class="document"><p class="text-center 
> expansion">.tiff</p><div class='del-img'></div></div></div>"""
>
> [image: uploadForm.png]
>

-- 
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/bf36b82f-f998-4508-a20b-1b60bcdca909%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to