QS 0.9.1 PORD
This commit is contained in:
parent
44d69d2d26
commit
97b9cc8e26
|
|
@ -742,16 +742,18 @@ def support(request):
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = request.POST
|
form = request.POST
|
||||||
|
fileblob = ""
|
||||||
attachments=[] #myfile is the key of a multi value dictionary, values are the uploaded files
|
attachments=[] #myfile is the key of a multi value dictionary, values are the uploaded files
|
||||||
for f in request.FILES.getlist('attachment_1'): #myfile is the name of your html file button
|
for f in request.FILES.getlist('attachment_1'): #myfile is the name of your html file button
|
||||||
filename = f.name
|
filename = f.name
|
||||||
attachment_type = filetype.guess(f)
|
attachment_type = filetype.guess(f)
|
||||||
fileblob = str(base64.b64encode(f.read()))
|
fileblob = str(base64.b64encode(f.read()))
|
||||||
fileblob = fileblob[1 : : ]
|
fileblob = fileblob[1 : : ]
|
||||||
fileblob = fileblob[1 : : ]
|
fileblob = fileblob[1 : : ]
|
||||||
fileblob = fileblob[:-1:]
|
fileblob = fileblob[:-1:]
|
||||||
attachments.append({str(filename) : "data:" + attachment_type.mime + ";base64," + fileblob})
|
attachments.append({str(filename) : "data:" + attachment_type.mime + ";base64," + fileblob})
|
||||||
|
fileblob = "data:" + attachment_type.mime + ";base64," + fileblob
|
||||||
|
|
||||||
for f in request.FILES.getlist('attachment_2'): #myfile is the name of your html file button
|
for f in request.FILES.getlist('attachment_2'): #myfile is the name of your html file button
|
||||||
filename = f.name
|
filename = f.name
|
||||||
attachment_type = filetype.guess(f)
|
attachment_type = filetype.guess(f)
|
||||||
|
|
@ -795,6 +797,8 @@ def support(request):
|
||||||
|
|
||||||
}
|
}
|
||||||
json_data = json.dumps(ostdata)
|
json_data = json.dumps(ostdata)
|
||||||
|
|
||||||
|
print(json_data)
|
||||||
r = requests.post("https://support.vh-solutions.de/api/http.php/tickets.json", data=json_data, headers=headers)
|
r = requests.post("https://support.vh-solutions.de/api/http.php/tickets.json", data=json_data, headers=headers)
|
||||||
|
|
||||||
# IF request FAILED error-Message
|
# IF request FAILED error-Message
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue