Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 27, 2023
1 parent 56a40e5 commit b73f5ee
Show file tree
Hide file tree
Showing 3 changed files with 791 additions and 624 deletions.
23 changes: 22 additions & 1 deletion app/Helpers/MainHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static function make_error_report(
$options = array_merge([
'error'=>"",
'error_code'=>"",
'details'=>json_encode(request()->instance())
'details'=>json_encode(request()->all())
],$options);
try{
if(Schema::hasTable('report_errors'))
Expand Down Expand Up @@ -260,6 +260,27 @@ public static function get_validations($type="file"){
else if($type=="image")
return "jpeg,bmp,png,gif";
}
public static function allowed_files_mimetypes($type="file"){

$file = ['video/3gpp','application/x-7z-compressed','application/x-7z-compressed','application/postscript','application/vnd.android.package-archive','video/x-msvideo','application/octet-stream','image/bmp','application/x-bzip2','text/css','text/csv','application/msword','application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/vnd.python.egg','video/x-flv','image/gif','application/gzip','video/h264','text/html','text/html','application/itch','image/icns','image/vnd.microsoft.icon','image/jpeg','image/jpeg','video/x-m4v','text/markdown','text/markdown','application/vnd.ms-access','video/x-matroska','video/quicktime','audio/mpeg','video/mp4','video/mpeg','video/mpeg','audio/mpeg','application/octet-stream','application/vnd.oasis.opendocument.presentation','application/vnd.oasis.opendocument.spreadsheet','application/vnd.oasis.opendocument.text','audio/ogg','font/otf','application/x-pak','application/pdf','application/x-pea','image/png','application/vnd.ms-powerpoint','application/vnd.ms-powerpoint','application/vnd.openxmlformats-officedocument.presentationml.presentation','image/vnd.adobe.photoshop','application/x-rar-compressed','application/vnd.rn-realmedia','application/rss+xml','application/rtf','application/x-7z-compressed','application/sql'/*,'image/svg+xml'*/,'application/x-tar','application/gzip','application/x-bzip2','application/x-tex','application/gzip','image/tiff','image/tiff','application/x-lzma','font/ttf','text/plain','video/dvd','audio/wav','video/webm','audio/x-ms-wma','video/x-ms-wmv','application/xhtml+xml','application/vnd.ms-excel','application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet','application/xml','application/x-compress','application/zip','application/x-zip-compressed'];

$image= ['image/bmp','image/gif','image/jpeg','image/jpeg','image/png','image/vnd.microsoft.icon','image/jpeg','image/tiff','image/tiff'/*,'image/svg+xml'*/,'image/png','image/vnd.adobe.photoshop'];

$video = ['video/3gpp','video/x-msvideo','video/x-flv','video/h264','video/x-m4v','video/quicktime','video/mp4','video/mpeg','video/mpeg','video/x-matroska','video/vnd.rn-realmedia','video/webm','video/x-ms-wma','video/x-ms-wmv','video/dvd'];

$pdf = ['application/pdf'];

if($type=="file")
return $file;
elseif($type=="image")
return $image;
elseif($type=="video")
return $video;
elseif($type=="pdf")
return $pdf;
else
return [];
}



Expand Down
Loading

0 comments on commit b73f5ee

Please sign in to comment.