Skip to content

Commit

Permalink
return file name and size
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Nov 30, 2021
1 parent 317ba8e commit c522cd6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import json
import shutil

from os import environ, path, makedirs, listdir, remove
from os import environ, path, makedirs, listdir, remove, scandir
import uuid

from flask import Blueprint, jsonify, request, send_from_directory
Expand Down Expand Up @@ -134,7 +134,9 @@ def upload():


def list_files_from_directory(file_directory: str):
files = listdir(file_directory)
files = []
for entry in scandir(file_directory):
files.append({"fileName": entry.name, "size": entry.stat().st_size})
return files


Expand Down

0 comments on commit c522cd6

Please sign in to comment.