File uploat from a form – Project planner

Home Forums Shard – HTML5 Template File uploat from a form – Project planner

This topic contains 13 replies, has 2 voices, and was last updated by  ab-themes 8 years, 2 months ago.

Viewing 4 posts - 11 through 14 (of 14 total)
  • Author
    Posts
  • #14185

    ab-themes
    Keymaster

    Also you have mentioned you would like to allow only some file types. Here is the code:

    if (isset($_FILES['uploaded_file']) && $_FILES['uploaded_file']['error'] == UPLOAD_ERR_OK) {
    	$allowed =  array('txt','doc','jpg');
    	$filename = $_FILES['uploaded_file']['name'];
    	$ext = pathinfo($filename, PATHINFO_EXTENSION);
    	if(!in_array($ext,$allowed) ) {
    		$message = 'Attachment type not allowed!';
    	}
    }

    It needs to be placed before this line

    if($message=='' && (isset($_POST['action']) && $_POST['action']=='js')){

    I have already type it there and tested it, you will just need to add more extensions you would like to allow

    Cheers :)

    #14199

    piki007
    Participant

    I seems to be working now on demo, but there is a problem with filetypes. It does not take pdf files, or doc , docx files … that are verry common web files. Where can I add additional file types.

    Regards, Matjaz

    #14200

    piki007
    Participant

    Upsss … I see filetypes … I was tooo quick … I will try it.

    #14213

    ab-themes
    Keymaster

    Ok, please let us know if everything is working when you try it.

Viewing 4 posts - 11 through 14 (of 14 total)

The topic ‘File uploat from a form – Project planner’ is closed to new replies.