Getting the upload object directly

Home Forums Quform WordPress Getting the upload object directly

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12197
    pczjrh
    Participant

    Hi,
    how do you get the upload object directly?

    I’m trying to pass the object into getimagesize() and return some image dimensions.
    When this code runs during upload the file is reported as being missing. Which is why the getimagesize() function is returning nothing.
    This code is part of my_post_process($form), so I assume by this point the file should have been moved into place (which I assume it has as the URL is correct and file renamed).

    Any thoughts as to why this isn’t working?
    Thanks in advance.
    Jason

    $file = $form->getValue('iphorm_1_3');
    $file_url=preg_replace('/[^a-zA-Z0-9:.\/_-]/','%20',$file[0]['url']);
    if (file_exists((string)$file_url)){
    $file_exists="File Exists";
    }else{
    $file_exists="File isn't there!";
    }
    $ImageDims = getimagesize((string)$file_url);
    $width = $ImageDims[0];
    $widthInt = (int)$width;
    $height = $ImageDims[1];
    $heightInt = (int)$height;

    #12211
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy