[help] the uploaded file is processed for the first time; the file uploaded by diydjango is in the wrong format.

Files uploaded through django are always in the wrong format. The picture cannot be opened
class FileUploadView (APIView):

parser_classes = (FileUploadParser,)

def post(self, request, filename, format=None):
    print filename
    file_obj = request.data["file"]
    file_dest = join(MEDIA_ROOT,"pic",filename)
    print file_obj.multiple_chunks()
    with open(file_dest,"w") as f:
        for chunk in file_obj.chunks():
            f.write(chunk)
    -sharp ...
    -sharp do some stuff with uploaded file
    -sharp ...
    return Response(status=204)
    

the original content is in the red box,
clipboard.png


:

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36524-2ad4b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36524-2ad4b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?