test
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • brentwilliams2 Friend
    #207297

    I had an issue where the system-generated PDF would not download for an application from within the back-end. I tried to find out what happened, when I noticed that the file name in the ja_applications database was slightly different from the actual file in the system. These are the same as my experience, although I slightly altered the name so the applicant would not be identified:

    Listed in the database: images/stories/jbuploads//applications/20150612110641XXX-YYYYYY_resume_27161.pdf

    The actual file name: 20150612110640XXX-YYYYYY_resume_27161.pdf

    The difference was found in the code at the beginning:

    20150612110641XXX-YYYYYY_resume_27161.pdf
    20150612110640XXX-YYYYYY_resume_27161.pdf

    If you can’t tell, the 14th digit is different between the two. I realize that the first 8 digits are from the date, but does the “110641” represent the time? Do you know why that could be slightly off between the two?

    This is an issue because it breaks the ability to view the applications. I have had issues before sporadically with employers not being able to view the applications and never noticed this issue. I don’t know if it is a common issue or not.

    Thanh Nguyen Viet Friend
    #574150

    Hello,

    To resolve this issue please open the file:

    Find the code snippet
    [PHP]$pdf->Output(JPATH_SITE . $uploadfolder.’/applications/’.date(‘Ymdhms’) . $filename, ‘F’);
    @chmod(JPATH_SITE . $uploadfolder.’/applications/’.date(‘Ymdhms’) . $filename, 0644);

    return substr($uploadfolder, 1).’/applications/’.date(‘Ymdhms’) . $filename;[/PHP]

    And replace it with:[PHP]
    $filename = date(‘Ymdhms’) . $filename;
    $pdf->Output(JPATH_SITE . $uploadfolder.’/applications/’.$filename, ‘F’);
    @chmod(JPATH_SITE . $uploadfolder.’/applications/’.$filename, 0644);

    return substr($uploadfolder, 1).’/applications/’.$filename;[/PHP]

    This issue is occured because in current code, the date function is call 3 times, and it returns different date time string on each call, so the file name is not consistent between name of file store in file system and database.

    Thanh Nguyen Viet Friend
    #640489

    Hello,

    To resolve this issue please open the file:

    Find the code snippet
    [PHP]$pdf->Output(JPATH_SITE . $uploadfolder.’/applications/’.date(‘Ymdhms’) . $filename, ‘F’);
    @chmod(JPATH_SITE . $uploadfolder.’/applications/’.date(‘Ymdhms’) . $filename, 0644);

    return substr($uploadfolder, 1).’/applications/’.date(‘Ymdhms’) . $filename;[/PHP]

    And replace it with:[PHP]
    $filename = date(‘Ymdhms’) . $filename;
    $pdf->Output(JPATH_SITE . $uploadfolder.’/applications/’.$filename, ‘F’);
    @chmod(JPATH_SITE . $uploadfolder.’/applications/’.$filename, 0644);

    return substr($uploadfolder, 1).’/applications/’.$filename;[/PHP]

    This issue is occured because in current code, the date function is call 3 times, and it returns different date time string on each call, so the file name is not consistent between name of file store in file system and database.

    Thanh Nguyen Viet Friend
    #739164

    Hello,

    To resolve this issue please open the file:

    Find the code snippet

    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 'F');
    @chmod(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.date('Ymdhms') . $filename;

    And replace it with:

    $filename = date('Ymdhms') . $filename;
    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.$filename, 'F');
    @chmod(JPATH_SITE . $uploadfolder.'/applications/'.$filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.$filename;

    This issue is occured because in current code, the date function is call 3 times, and it returns different date time string on each call, so the file name is not consistent between name of file store in file system and database.

    brentwilliams2 Friend
    #576325

    Can you tell me which file this is in? The only thing I found similar was in models/jaapplications.php:

    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 'F'); @chmod(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.date('Ymdhms') . $filename;

    That’s obviously not quite the same code though…

    brentwilliams2 Friend
    #642646

    Can you tell me which file this is in? The only thing I found similar was in models/jaapplications.php:

    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 'F'); @chmod(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.date('Ymdhms') . $filename;

    That’s obviously not quite the same code though…

    brentwilliams2 Friend
    #741305

    Can you tell me which file this is in? The only thing I found similar was in models/jaapplications.php:

    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 'F'); @chmod(JPATH_SITE . $uploadfolder.'/applications/'.date('Ymdhms') . $filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.date('Ymdhms') . $filename;

    That’s obviously not quite the same code though…

    Luna Garden Moderator
    #576408

    Yes, it’s on file models/jaapplications.php.

    The code after adding to reply box the character ‘@’ turning to [MENTION=80566] so that’s why you see they’re different.

    Luna Garden Moderator
    #642724

    Yes, it’s on file models/jaapplications.php.

    The code after adding to reply box the character ‘@’ turning to [MENTION=80566] so that’s why you see they’re different.

    Luna Garden Moderator
    #741381

    Yes, it’s on file models/jaapplications.php.

    The code after adding to reply box the character ‘@’ turning to [MENTION=80566] so that’s why you see they’re different.

    brentwilliams2 Friend
    #576625

    $filename = date('Ymdhms') . $filename;
    $pdf->Output(JPATH_SITE . $uploadfolder.'/applications/'.$filename, 'F'); @chmod(JPATH_SITE . $uploadfolder.'/applications/'.$filename, 0644);

    return substr($uploadfolder, 1).'/applications/'.$filename;

    So just to be clear, this is the code that needs to be used, correct?

    brentwilliams2 Friend
    #576627

    (Although I see that my code was messed up a bit. Should be “chmod” not “chmo d”

    Luna Garden Moderator
    #576659

    <em>@brentwilliams2 481713 wrote:</em><blockquote>(Although I see that my code was messed up a bit. Should be “chmod” not “chmo d”</blockquote>

    Yes, give it a try again and inform me the results.

    brentwilliams2 Friend
    #576740

    So far so good! I’ve tested out the applications received since then and have had no issues.

    brentwilliams2 Friend
    #643053

    So far so good! I’ve tested out the applications received since then and have had no issues.

Viewing 15 posts - 1 through 15 (of 16 total)

This topic contains 16 replies, has 3 voices, and was last updated by  brentwilliams2 9 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum