-
AuthorPosts
-
brentwilliams2 Friend
brentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
June 12, 2015 at 5:41 pm #207297I 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.pdfIf 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 FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 16, 2015 at 2:51 am #574150Hello,
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 FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 16, 2015 at 2:51 am #640489Hello,
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 FriendThanh Nguyen Viet
- Join date:
- September 2014
- Posts:
- 1461
- Downloads:
- 0
- Uploads:
- 44
- Thanked:
- 258 times in 217 posts
June 16, 2015 at 2:51 am #739164Hello,
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 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 3, 2015 at 5:45 pm #576325Can 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 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 3, 2015 at 5:45 pm #642646Can 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 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 3, 2015 at 5:45 pm #741305Can 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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
July 6, 2015 at 3:33 am #576408Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
July 6, 2015 at 3:33 am #642724Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
July 6, 2015 at 3:33 am #741381brentwilliams2 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 7, 2015 at 3:42 pm #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 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 7, 2015 at 3:47 pm #576627(Although I see that my code was messed up a bit. Should be “chmod” not “chmo d”
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
July 8, 2015 at 2:08 am #576659brentwilliams2 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 8, 2015 at 4:39 pm #576740So far so good! I’ve tested out the applications received since then and have had no issues.
brentwilliams2 Friendbrentwilliams2
- Join date:
- January 2013
- Posts:
- 231
- Downloads:
- 0
- Uploads:
- 23
- Thanks:
- 4
- Thanked:
- 33 times in 1 posts
July 8, 2015 at 4:39 pm #643053So far so good! I’ve tested out the applications received since then and have had no issues.
-
AuthorPosts
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