Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › please have a look alex
- This topic has 11 replies, 3 voices, and was last updated 2 years, 4 months ago by Anshuman Sahu.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
July 18, 2022 at 1:20 pm #387074Ernesto LeeParticipantWhen i go into a unit to add files - it restricts what files I can upload. I need to be able to upload .exe files and .ipynb and .py files and probably a few other types but at a minimum those file types.July 19, 2022 at 3:51 pm #387146Anshuman SahuKeymasterWell yes these are not allowed by wordpress itself since these type of files can hack the server , you can zip these files and then upload .July 22, 2022 at 8:10 pm #387300Ernesto LeeParticipant:( :( is there anyway we can achieve this?July 23, 2022 at 4:07 pm #387336Anshuman SahuKeymasterWell we are using wordpress core function wp_handle_upload for upload process , so if wp allows those file types it will be uploaded . you can look for third party plugins to allow file types in wordpress . can try this : https://wordpress.org/plugins/wp-extra-file-types/ but not sure if it works . IMPORTANT : We would still recommend you to not allow these file types to upload on server due to security issues .SITE MAY GET HACKED. Zip them and upload .July 25, 2022 at 2:10 pm #387378Ernesto LeeParticipantThis reply has been marked as private.July 26, 2022 at 2:25 pm #387407VeronicaModeratorlet us knowJuly 28, 2022 at 7:22 pm #387501Ernesto LeeParticipantThis reply has been marked as private.July 28, 2022 at 7:27 pm #387502Ernesto LeeParticipantThis reply has been marked as private.July 29, 2022 at 2:18 pm #387525Anshuman SahuKeymasteryou can try this code in wplms-custmizer.php file in wplms customizer plugin :
function svgz_mime_types( $mimes ) { // SVGZ allowed mime types. $mimes['exe'] = 'application/octet-stream'; $mimes['py'] = 'text/x-python'; return $mimes; } add_filter( 'upload_mimes', 'svgz_mime_types' );
August 2, 2022 at 12:17 pm #387625Ernesto LeeParticipantcan you share a video how it works in assignment and unit type uploads?? thanks for your helpAugust 2, 2022 at 12:21 pm #387626Ernesto LeeParticipantThis reply has been marked as private.August 3, 2022 at 11:56 am #387655Anshuman SahuKeymasterWell for units it seems not possible .Please use the zip file approach .While in assignments its possible :add_filter('wplms_assignments_upload_mimes_array',function($mimes){ $mimes['Python'] = []; $mimes['Python'][]='application/x-python-code'; $mimes['Python'][]='text/x-python'; return $mimes; }); add_filter('wplms_course_creation_tabs',function($tabs){ foreach ($tabs['course_curriculum']['fields'] as $key => $field) { if($field['id'] == 'vibe_course_curriculum'){ if(!empty($field['curriculum_elements'])){ foreach ($field['curriculum_elements'] as $k => $elements) { if($elements['type']=='assignment'){ foreach ($elements['types'] as $j => $type) { if(!empty($type['fields'])){ foreach($type['fields'] as $h=> $field){ if($field['id']=='vibe_attachment_type'){ $tabs['course_curriculum']['fields'][$key]['curriculum_elements'][$k]['types'][$j]['fields'][$h]['options'][] = array('value'=> 'Python','label' => 'Python'); } } } } } } } } } return $tabs; });
-
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)
- The topic ‘please have a look alex’ is closed to new replies.