Jump to content

file upload


ibolui

Recommended Posts

hi, i would like to seek recommendation regarding file upload. i have read that to prevent local file inclusion vulnerability, a uploaded file should randomly generating file name for it and keeping track in a database.

 

http://www.scanit.be/uploads/php-file-upload.pdf

 

i am wondering about the feasibilty of it because if there are huge number of files such as a gallery website, would it be advisable to use this approach? if not, what can be done?

Link to comment
https://forums.phpfreaks.com/topic/106884-file-upload/
Share on other sites

The database space and bandwidth requirement will pale in comparision to the requirements of the images themselves.

 

Is it required? Well if you do time().microtime(); technically no because it is highly unlikely two people will execute at the same time and take the same time for server transfer.

 

However having said that for your records, keeping track of the files, and allowing user ease (because if you are allowing them to create custom galleries then it is pretty much a must for DB) I would HIGHLY recommend a DB. Like I said, you're planning on commiting substantial resources to the images the DB will seem insignificant.

Link to comment
https://forums.phpfreaks.com/topic/106884-file-upload/#findComment-547904
Share on other sites

if i understand correctly... the article said that the purpose of putting the files outside website root is to prevent users from accessing the files directly. but then this solution may leads to local file inclusion attacks. hence to rename the files uniquely and keep track in database.

 

i think putting the files outside website root is a very good idea, but i think that will be a overkill to read and write those files via the database. is there another method to prevent local file inclusion attacks beside the method mentioned in the article?

Link to comment
https://forums.phpfreaks.com/topic/106884-file-upload/#findComment-547915
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.