.exe files

iguanashare4743

New Member
YetiShare User
Feb 7, 2015
125
0
0
i already did that but its not working , i can still upload such files ,enter my site and see by urself :(
 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
I don't know what you've done, but if you upload a .exe file less than 5mb on my dev site it blocks it using the same file as you're using.




Feel free to try it out

https://www.ysmods.com/dev/
 

ashenat5038

New Member
YetiShare User
Apr 26, 2015
1
0
0
iguanashare4743 said:
i already did that but its not working , i can still upload such files ,enter my site and see by urself :(
Try to change 'application/x-msdownload' in the code to 'application/octet-stream'
this solved my problem
the new code will be
Code:
// Edit the 3 options in the line below within the single quotes '' to prevent file uploads
if($fileUpload->type == 'application/octet-stream' && $fileUpload->size >= '61440' && $fileUpload->size <= '454660')
{
   $fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
}
Thanks ysmods for the code
 

khpoletik4670

New Member
Jan 19, 2015
11
0
0
Hey guys

I'm thinking about why you are going to block all .exe files, maybe you are trying to block those .exe (193 KB) spam files:



if I'm right I think it's better to find a solution to block files based on their MD5 hashes not based on their extensions, because all those .exe spam files have the same MD5 hash "a6c95227edd022185a6021ea77a07fe6"

 

ysmods

New Member
Jan 29, 2013
860
1
0
UK
www.ysmods.com
The code can easily be modified

Code:
INSERT INTO site_config VALUES
(null, 'blocked_file_hashes', '', 'The file md5 hashes that are not allowed to be uploaded. Separate items with a comma, without spaces.', '', 'string', 'File Uploads');
Code:
$blocked = explode(',', SITE_CONFIG_BLOCKED_FILE_HASHES);
foreach ($blocked as $filehash)
{
	if(md5_file($uploadedFile) == $filehash)
	{
		$fileUpload->error = t('classuploader_kill_upload_error', 'The file you are uploading is not allowed to be uploaded to this site.');
	}			
}