Skip to content

Commit

Permalink
sdaf
Browse files Browse the repository at this point in the history
asdf
  • Loading branch information
grisuno committed Jun 27, 2024
1 parent a563696 commit 2e0e4d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def download_file(filename):

@app.route('/upload', methods=['POST'])
def upload_file():
print(request)
print(request) # Imprime la solicitud para depuración
print(request.files) # Imprime el diccionario de archivos en la solicitud
print(request.form) # Imprime el diccionario de otros datos del formulario
if 'file' not in request.files:
return f'No file part{request}', 400

Expand Down
5 changes: 4 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ <h5>Output:</h5>
event.preventDefault(); // Evita el envío estándar del formulario
var formData = new FormData(this);


// Imprime los datos del formulario para depuración
for (var pair of formData.entries()) {
console.log(pair[0] + ', ' + pair[1]);
}
fetch("/upload", {
method: "POST",
body: formData
Expand Down

0 comments on commit 2e0e4d4

Please sign in to comment.