Issue Number | 485 |
---|---|
Summary | [Literature] Unable to upload PDF for some citations |
Created | 2018-10-19 11:22:45 |
Issue Type | Bug |
Submitted By | Juthe, Robin (NIH/NCI) [E] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2018-10-19 11:34:55 |
Resolution | Won't Fix |
Path | /home/bkline/backups/jira/oceebms/issue.234628 |
We are unable to upload some PDFs that come from PubMed. I'm attaching an example and will post a screenshot of the error message. As a workaround, Bonnie has been printing and scanning the PDF, saving it as a new PDF on her computer, and uploading the scanned version.
Ah, I just realized our file size limit is 20MB (OCEEBMS-264). Looks like the workaround we established is to compress the file and try again, so we will give that a shot. However, it would be helpful to have a more informative error message for these cases.
Yup, that did it. In case it's helpful in the future, we used https://www.foxitsoftware.com/compress-pdf/ to compress the file for free online.
I'll file a new ticket to review the error messages.
diff --git a/ebms.nci.nih.gov/modules/custom/ebms/citations.inc b/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
index 3473862..91bb736 100644--- a/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
+++ b/ebms.nci.nih.gov/modules/custom/ebms/citations.inc
@@ -2631,7 +2631,8 @@ namespace {
$mime_type = Ebms\Util::get_mime_type($path);
if ($mime_type != 'application/pdf') {
drupal_set_message(htmlspecialchars($value) .- ' is not a PDF file.', 'error');
+ ' is not a PDF file or exceeds the limit of 20MB.',
+ 'error');
continue;
} $file = file_save_upload($key, $validators);
(BTW, CBIIT tells me they're going to apply a fix for the JIRA bug which causes the bogus error message at the top of this comments. More than a year after the fix became available.)
File Name | Posted | User |
---|---|---|
EBMS PDF error message.png | 2018-10-19 11:24:18 | Juthe, Robin (NIH/NCI) [E] |
Soukupova PLoSOne 2018 29649263.pdf | 2018-10-19 11:23:08 | Juthe, Robin (NIH/NCI) [E] |
Elapsed: 0:00:00.000702