PHP and database

0

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?

    
asked by anonymous 18.05.2015 / 15:25

3 answers

1

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:

  • physical path on the server
  • file url
  • file size

Among many other information that could come from the archive.

    
19.06.2015 / 08:05
0

Use a VARCHAR and store only the physical path of the file on your server

    
18.05.2015 / 17:02
0

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.

    
19.06.2015 / 06:22