Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COHi, I wasn't intending on changing the names of these particular files. What is the benefit of that? If it's called "Training Handout 1.pdf" I was then hoping to be able to pull that from the database and display it on another page as a link for soemone to download. And permissions..would you mind explaining please?
      singulars
    2. CO@user2608855 Think about it this way. You have a folder uploads, you store everything there. User A uploads a file called "abc.pdf", the user B uploads another file called "abc.pdf". They are not the same, so what will you do now ? I've see the following solution: when someone uploads a file, you rename the file to a unique filename (for example hashing+timestamp?) and store it in the folder uploads. You store the original filename along with the unique filename in the database so that you can always retrieve them. You can also add other info about the file if you want.
      singulars
    3. COWell, you don't want someone to upload an executable file (a file that executable permissions) that they can find on your web server (because they know the name of it) and run. So, I would check the mime-type of the uploaded file to make sure that it's a type of file you're willing to accept (like a PDF or RTF file, for example), then, I'd change the name of it, so you that you know its name, but the uploader doesn't. Then, using chmod, I'd change the permissions of the file to 0644 http://php.net/manual/en/function.chmod.php
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload