Well, I'm working on a website and need to store a file uploaded / uploaded by the user to a database. What kind of data should I assign to the field?
Well, I'm working on a website and need to store a file uploaded / uploaded by the user to a database. What kind of data should I assign to the field?
Use VARCHAR by placing the physical path on the server. Take a look at the entire application to see if it is not necessary to have a table just for files, so you could put more information about the files in this table.
How to:
Among many other information that could come from the archive.
Use a VARCHAR and store only the physical path of the file on your server
If the file link is complete, with http: // ... use VARCHAR
with Size 250
(the maximum supported in a VARCHAR field). If you see that the field is too long and exceeds 250 characters, use TEXT
that supports many characters.