Upload the File
Closed this issue · 4 comments
victoriagjh commented
Todo
- upload the file to local
- check the file type(txt, csv,json,excel etc..)
- display the file at Second Page
Related Issues
#1 Basic Web Design
victoriagjh commented
- search the file extension of text
victoriagjh commented
- check the file name duplicated
if file name is duplicated, file name is changed and can be read another file
victoriagjh commented
def user_directory_path(instance, filename):
# file will be uploaded to MEDIA_ROOT/user_/
return 'user_{0}/{1}'.format(instance.user.id, filename)
class MyModel(models.Model):
upload = models.FileField(upload_to=user_directory_path)
#(https://docs.djangoproject.com/en/2.2/ref/models/fields/#filefield)
victoriagjh commented
Implemented user can upload only "txt"