How does Python solve this problem?

CSDN Q & A 2022-01-15 04:17:33 阅读数:577

python solve problem

problem :
Usually , When uploading avatars on the website, you need to upload picture files in the specified format according to the requirements of the website , If you upload a non specified file format, an error message will appear . for example , A website only allows users to upload jgp、png and bmp File format ( That is, the name of the uploaded picture must be in jgp、png and bmp For the suffix ), If you upload files in other formats , The user will be prompted that the format is incorrect . Add the following code , It is required to enter the file name according to the ( Include suffix ), The function of user upload avatar format detection is realized through exception capture statement .




Refer to the answer 1:

What is the answer




Refer to the answer 2:
版权声明:本文为[CSDN Q & A]所创,转载请带上原文链接,感谢。 https://pythonmana.com/2021/12/202112112255333740.html