News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Bug Report: 404 Error after successful front-end upload (ID=0)

Started by musicasampler, 02.05.2026 10:56:26

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

musicasampler

am experiencing a critical issue when uploading MIDI files from the front-end in Joomla 5. After a successful upload, the system redirects to a 404 Error page with the URL showing view=download&id=0 (or a_id=0).

Technical Findings:

Physical File: The file is successfully uploaded to the server's folder (confirmed via FTP).

Database Issue: Despite the file being present on the server, the record does not seem to be correctly retrieved or created in the #__jdownloads_files table during the redirection process.

Code Trace: I have inspected Site\Model\DownloadModel.php and found that the error is triggered within the getItem() function. The $item object returns empty, which throws the 404 Exception.

Category Conflict: This issue started after modernizing the "Details" and "Summary" templates. I suspect a potential conflict between the new Bootstrap 5 layouts and the innerJoin query with the categories table, especially regarding access levels or publication states.

Environment:

Joomla Version: 5.4.5

jDownloads Version: 4.x

Templates tested: Both "Standard Bootstrap 5" and "Standard v3.9" (the error persists in both, ruling out a simple CSS/HTML layout issue).

Request:
Could you please verify if there is a known timing issue or a bug in how the ID is passed to the redirection URL in the latest Joomla 5 environment?
  •  
    The following users thanked this post: Arno

Arno

Hello,
thank you for the report. If the upload itself succeeds but the redirect ends with id=0 or a_id=0, then this looks like a real bug in the front-end upload/save or redirect flow, not a template styling issue.

So the likely problem is that after saving the upload, no valid download ID is passed into the redirect URL.

Please tell us:
1. Does the uploaded entry appear in the database table #__jdownloads_files?
2. Does this happen for every front-end upload or only for specific files?
3. Does it also happen with SEF disabled?

This should help us determine whether the record is not saved correctly or whether only the redirect URL is built incorrectly afterwards.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Arno

Hello,
I have now added a first fix for the front-end upload redirect flow (please use the new version 4.1.4 that I'll send you via PM).

The issue looked less like a template problem and more like a save/redirect problem after creating a new front-end download:
the upload file could already be written successfully, but the redirect could still fall back to an empty form state with id=0.

I have adjusted the redirect handling so that after a successful new front-end upload, the saved item ID is used correctly instead of falling back to a_id=0. I also hardened the return-link handling a bit.

Please test again with the same workflow and let us know:

1. whether the upload still ends on a 404 page
2. whether the redirect now opens the created download/edit page correctly
3. whether this changes with SEF on or off

Thanks!
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

musicasampler

Hi Arno,

I have an important update regarding this issue and I would like to apologize for the confusion. I discovered that the problem was not actually a bug in jDownloads, but rather a configuration issue with my Joomla Mail Settings.

Technical Root Cause:
After several tests, I found that when a member uploaded a MIDI file, the file was being processed and saved correctly in the database and folder. However, because the Joomla global mail system was failing to send the "New Upload" notification, the process was being interrupted. This interruption prevented the final redirection, resulting in the 404 error (ID=0).

The Solution:
Once I fixed the SMTP/Mail settings in Joomla's Global Configuration, everything returned to normal. The notifications are now being sent correctly, and jDownloads redirects the user to the success page without any errors.

Important Note for the Community:
If anyone experiences a 404 error after a successful upload, I recommend checking your Joomla mail configuration first. If the notification fails to send, it may break the redirection flow even if the file was received perfectly.

Thank you again for your quick support and for providing version 4.1.4. It turns out the component is working perfectly!

Best regards,
  •  

Arno

Hi,
thank you very much for the clarification and for taking the time to track this down.

So the actual cause was not the front-end template or a general jDownloads redirect bug, but the Joomla mail configuration.
The upload itself was processed correctly, but the failed notification email interrupted the remaining workflow.

I have therefore kept only a small hardening fix on our side so that a failed upload notification email should no longer break an already saved front-end upload.

Thank you again for the detailed follow-up. This information is very helpful for us and for other users who may see a similar symptom.

Best regards
Arno
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!