General developer forum

file not found

 
Picture of A. Obeid
Re: file not found
Particularly helpful Moodlers

Solved

    $itemid=0;
    $fs = get_file_storage();   
    $draftcontext = context_user::instance($USER->id);
    $draftitemid = file_get_submitted_draft_itemid($draftcontext->id);   
    file_prepare_draft_area($draftitemid, $draftcontext->id, 'user', 'draft', $itemid);        
    $filerecord = array(
        'contextid' => $draftcontext->id, 
        'component' => 'user', 
        'filearea' => 'draft',
        'itemid' => $draftitemid,
        'filepath' => '/',
        'filename'=>$filename);
    $urlparams = array(
            'calctimeout' => false,
            'timeout' => 5,
            'skipcertverify' => true,
            'connecttimeout' => 5
        );
    try....
 
Average of ratings: -