×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
How to retain a previously uploaded file?
Greg Podesta
New Member
Posts: 5
8 年 1 个月 前 - 8 年 1 个月 前 #1435
由 Greg Podesta
How to retain a previously uploaded file? was created by Greg Podesta
I'm using a File input to allow uploading a file that is relevant to the record and all works as expected, except one critical thing:
When the item form is initially displayed for editing, a link to the file appears and works, but submitting other updates blanks out the field.
Surely this isn't expected behavior, so I'm not sure what I'm doing wrong. I want to be able to save the record, leaving the previously uploaded file intact.
Also, on a slightly related note, is there "somewhere", perhaps a plugin where the uploaded file can be processed at the time of upload (to extract certain metadata from within the file itself)?
FURTHER OBSERVATIONS:
I see that the originally uploaded file is being retained in a hidden input field, so I see that it "should" be retained, however something weird is happening:
<input type="hidden" name="jform[agenda_pdf][]" id="jform_agenda_pdf_hidden" value="0Agenda.pdf" />
When the Submit button is clicked, this hidden field is NOT included in the fields that are posted, thus the code in the table is blanking it out as it should. I see some javascript that is manipulating this value on submission, but I can't see to follow what is going on, so can't see why this field is being excluded from the POST.
When the item form is initially displayed for editing, a link to the file appears and works, but submitting other updates blanks out the field.
Surely this isn't expected behavior, so I'm not sure what I'm doing wrong. I want to be able to save the record, leaving the previously uploaded file intact.
Also, on a slightly related note, is there "somewhere", perhaps a plugin where the uploaded file can be processed at the time of upload (to extract certain metadata from within the file itself)?
FURTHER OBSERVATIONS:
I see that the originally uploaded file is being retained in a hidden input field, so I see that it "should" be retained, however something weird is happening:
<input type="hidden" name="jform[agenda_pdf][]" id="jform_agenda_pdf_hidden" value="0Agenda.pdf" />
When the Submit button is clicked, this hidden field is NOT included in the fields that are posted, thus the code in the table is blanking it out as it should. I see some javascript that is manipulating this value on submission, but I can't see to follow what is going on, so can't see why this field is being excluded from the POST.
Last edit: 8 年 1 个月 前 by Greg Podesta.
Please 登录 或 注册一个帐号 to join the conversation.
Santiago Crespo Calvo - NIF 29159210V
New Member
Posts: 3
7 年 10 个月 前 #1458
由 Santiago Crespo Calvo - NIF 29159210V
Replied by Santiago Crespo Calvo - NIF 29159210V on topic How to retain a previously uploaded file?
Hello
I've the same problem. ¿Have you solved it?
Best regards
Santiago
I've the same problem. ¿Have you solved it?
Best regards
Santiago
Please 登录 或 注册一个帐号 to join the conversation.
Andres Maeso
Platinum Member
Posts: 338
7 年 10 个月 前 #1461
由 Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。
Replied by Andres Maeso on topic How to retain a previously uploaded file?
Hi
We had to chose an standard behaviour for this and it's the one you describe. There're many ways of doing this depending on the desired final result, so it has to be manually customized. If you are unsure on how to do this, please send a support ticket and we will gladly assist you.
Regards,
Andrés.
We had to chose an standard behaviour for this and it's the one you describe. There're many ways of doing this depending on the desired final result, so it has to be manually customized. If you are unsure on how to do this, please send a support ticket and we will gladly assist you.
Regards,
Andrés.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。
Please 登录 或 注册一个帐号 to join the conversation.
创建页面时间:0.057秒