• Resolved Dennis Bareis

    (@dbareis)


    I have an “Upload Only (Plupload)” field called “newsletter_file” which I want to update programmatically with the PODS PHP function “save()”.

    I know how to update most other types of fields, so assuming the file is already uploaded what should the variable “$PdfFile” in the following code look like (I have tried strings with the basename of the file and the full name of the file:

    $Data = array(
      'post_status' => 'publish',
      'name' => $NewsletterTitle,
      'newsletter_file' => $PdfFile,
    //'newsletter_file' => $PdfSn,
    );
    
    $NlID = $Pod->save($Data, null, $Pod->field('id'));

    It fails and nothing useful is logged (no file name provided):

    [05-Oct-2023 03:20:56 UTC] PHP Warning: copy(0): Failed to open stream: No such file or directory in /home/wcipporg/public_html/wp-content/plugins/pods/includes/media.php on line 258

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to “$Pod->save($Data …)” a FILE field’ is closed to new replies.