Fix a Drag-and-Drop PDF Upload That Acrobat Reader Cannot Open
Question details
Determine why a PDF uploaded by drag and drop cannot be opened, while the same PDF uploaded through a file dialog works.

- Product
- Adobe Acrobat Reader and the PDF upload application
- Device & OS
- not provided
- Scenario
- The same PDF is uploaded using a file dialog and a drag-and-drop interface, then stored for later opening.
- Observed behavior
- The stored files have matching lengths, but the drag-and-drop version has different bytes near the end and cannot be opened in Acrobat Reader.
Keep the original PDF and both uploaded versions available for comparison. Use a binary or hex viewer and a SHA-256 tool to inspect their bytes and checksums.
Trace and correct the drag-and-drop binary upload
Use this method to find where the drag-and-drop path changes PDF bytes and ensure the stored file matches the original.
Matching file lengths do not prove that the contents are identical. An extra character or altered bytes near the final %%EOF marker can indicate that the drag-and-drop or storage path has modified the file.
Open the original, file-dialog upload, and drag-and-drop upload in a hex viewer. Compare the bytes near the final %%EOF marker and calculate a SHA-256 checksum for each file.
In the application's drop event handler, inspect the File from dataTransfer.files. Upload the File as binary data, such as by appending it to FormData, rather than converting its contents to a text string.
Inspect the server's multipart file handling and database write and read code. Store the uploaded bytes in a binary field, and avoid text encoding or unnecessary binary-to-string conversions.
Calculate SHA-256 checksums for the original file, the received file before storage, and the retrieved file. Fix the first stage where the checksum changes, then upload the original again through drag and drop.
Open the newly retrieved PDF in Acrobat Reader and confirm that its checksum matches the original file.

Open PDF Files and Office Documents with WPS Office
WPS Office is a free, lightweight alternative for viewing PDFs and working with Office documents in a familiar interface. Its format compatibility helps make the move from Microsoft Office easier, though it cannot fix corruption in your upload pipeline.

Frequently Asked Questions
Can two PDF files have the same size but different contents?
Yes. Bytes can be replaced without changing the file length. Calculate a SHA-256 checksum for each file or compare them in a hex viewer to detect differences.
Does any character after %%EOF mean a PDF is corrupt?
Not necessarily. Whitespace may follow the final %%EOF marker, and viewer tolerance can vary. Compare the ending with the original PDF and investigate any unexpected changes.
How should a drag-and-drop handler send a PDF?
Get the File from dataTransfer.files in the drop event and append it to FormData, or otherwise send its bytes as binary data. Avoid reading the PDF as text before uploading it.
How can I tell whether the database changed the PDF?
Calculate a SHA-256 checksum immediately before the database write and again after reading the file back. If they differ, inspect the binary field and any encoding or conversion in the write and read paths.
Can WPS Office repair the drag-and-drop upload?
WPS Office can open a readable PDF, but it cannot correct changes made by an application's upload or database code. Fix the binary handling and upload the original PDF again.




