2

I've made an upload form on my site and was wondering if it's possible to make the upload folder and any file that gets up loaded non-executable?

I have taken other precautions like sanitizing anything that gets uploaded but I'd love to know if its possible to make my uploads folder and its contents non-executable

j08691
  • 204,283
  • 31
  • 260
  • 272
user1425394
  • 105
  • 2
  • 2
  • 9

1 Answers1

0

chmod -x sets the file/folder non-executable. You can apply chmod in PHP to each file after upload.

http://en.wikipedia.org/wiki/Chmod

Félix Sanz
  • 1,812
  • 4
  • 16
  • 27
  • cool thanks. will files that have been uploaded after i chmod -x be non-executable? – user1425394 Feb 01 '14 at 22:57
  • @user1425394 No, you need to chmod -x that files after uploading. But probably the files wouldn't upload with executable permissions anyway. – Félix Sanz Feb 02 '14 at 01:17