I'm stuck again!
I'm trying to use the dynamic "File Name Path" field within the File Downloader action and although it finds the file (pdf) it will not open in Adobe. However if I put the file name in the "File Name" field it works. I'm lost??
I'm trying to use the dynamic "File Name Path" field within the File Downloader action and although it finds the file (pdf) it will not open in Adobe. However if I put the file name in the "File Name" field it works. I'm lost??
Hi GabeDaly,
Sorry, I can't work out what the problem is. Does the file download, but then won't open in Adobe? Or is nothing downloading?
What settings to you have in the File Downloader action?
Bob
Sorry, I can't work out what the problem is. Does the file download, but then won't open in Adobe? Or is nothing downloading?
What settings to you have in the File Downloader action?
Bob
Yes the file downloads but won't open. It is in the form array as ['pdf_file'] and on the server as mtg_invoice_012345678.pdf Adobe says it is wrong file type or not decoded. Here are the settings I have:
Session to Data{
name: download
key: download
Clear After Load: No
}
File Downloader{
Download Type: Download
Downloads Path: JOOMLA_PATH/components/com_chronoforms/pdf/my_folder/
File Name:
File Name Path: pdf_file
}
I have confirmed that the pdf_file is called before the download action. If I leave the "File Name Path" blank and put the MTG_invoice_012345678.pdf in the "File Name" field it works great.
Thanks Bob
Session to Data{
name: download
key: download
Clear After Load: No
}
File Downloader{
Download Type: Download
Downloads Path: JOOMLA_PATH/components/com_chronoforms/pdf/my_folder/
File Name:
File Name Path: pdf_file
}
I have confirmed that the pdf_file is called before the download action. If I leave the "File Name Path" blank and put the MTG_invoice_012345678.pdf in the "File Name" field it works great.
Thanks Bob
Hi Gabedaly,
Nothing obvious I'm afraid. Sometimes acrobat gives messages a bit like that if the file is a newer version PDF. Please post a link to the form so I can take a quick look.
Bob
Nothing obvious I'm afraid. Sometimes acrobat gives messages a bit like that if the file is a newer version PDF. Please post a link to the form so I can take a quick look.
Bob
Hi Bob,
I sent you a few PM with the link to the form😶 . I am going to send you another one with backend access just in case.
I sent you a few PM with the link to the form😶 . I am going to send you another one with backend access just in case.
Hi Gabe,
First, there's a very irritating validation problem on the form before I can get to the Download Page. There's a start date input that is required but not visible. This means that I have to disable JavaScript to get past it.
When I get to the download page I can see that it is not a PDF at all but an HTML file - it appears to be the complete page HTML.
My best guess it that this is because there is no file name set in the File Downloader action so it grabs whatever looks convenient. I don't think that the downloader can handle dynamic file names :-(
Just building a simple link around the button might work OK??
Bob
First, there's a very irritating validation problem on the form before I can get to the Download Page. There's a start date input that is required but not visible. This means that I have to disable JavaScript to get past it.
When I get to the download page I can see that it is not a PDF at all but an HTML file - it appears to be the complete page HTML.
My best guess it that this is because there is no file name set in the File Downloader action so it grabs whatever looks convenient. I don't think that the downloader can handle dynamic file names :-(
Just building a simple link around the button might work OK??
Bob
Thank you Bob, I appreciate your feedback.
It's my first time playing with Ajax. The dynamic startdate select is hidden at first because it is based on two other inputs. I'll have to try and make it more user friendly.
The HTML on the download page was just for viewing pleasure. Prior to that I saved a pdf file to the server via TCPDF. This is the file I am trying to allow users to download. I could use another TCPDF for the download but my goal was to have the file names match to avoid confusion. It's odd because your email action has no problem grabbing it from the server and it displays correctly. I guess the file downloader really isn't good at dynamic file names.
I'll try to figure out how to retrieve the file another way. Maybe there is a FAQ for this? I'll look.
Thanks for all your time!
It's my first time playing with Ajax. The dynamic startdate select is hidden at first because it is based on two other inputs. I'll have to try and make it more user friendly.
The HTML on the download page was just for viewing pleasure. Prior to that I saved a pdf file to the server via TCPDF. This is the file I am trying to allow users to download. I could use another TCPDF for the download but my goal was to have the file names match to avoid confusion. It's odd because your email action has no problem grabbing it from the server and it displays correctly. I guess the file downloader really isn't good at dynamic file names.
I'll try to figure out how to retrieve the file another way. Maybe there is a FAQ for this? I'll look.
Thanks for all your time!
Hi Gabe,
Open the 'bad' pdf in a text editor and you'll see that it is just an HTML file - not a pdf at all.
And, yes the Download file action is not the world's brightest; I think it can only handle static files.
Bob
Open the 'bad' pdf in a text editor and you'll see that it is just an HTML file - not a pdf at all.
And, yes the Download file action is not the world's brightest; I think it can only handle static files.
Bob
Hi Bob,
Yes I can confirm that also! However if you were to open that file in the browser with the full address path it opens as a pdf just fine.
So it's saved to server as a pdf but the File Downloader doesn't pick it up and as you said grabs the most convenient thing it can, and shows the html as the downloaded file with the pdf name. :o
Yes I can confirm that also! However if you were to open that file in the browser with the full address path it opens as a pdf just fine.
So it's saved to server as a pdf but the File Downloader doesn't pick it up and as you said grabs the most convenient thing it can, and shows the html as the downloaded file with the pdf name. :o
Just wanted to update this thread.
My goal was to have a pdf sent as an email attachment and also allow users the ability to download it while keeping the same file name.
I used the TCPDF action to save the pdf to the server and to attach it to an email which works flawlessly.
However, the TCPDF assigns a date stamp to the end of the file name (to prevent overwriting) which resulted in a different name when trying to use this action for users to download too.
So, I figured I would be able to use the File Downloader to bypass this, but it does not work well with dynamic file names..
When nothing seemed to work, I took a look at the TCPDF code and found that if there already is a $form->data['pdf_file_name'] in the form data array, it will use that as the file name.😀
I was able to achieve my goal with the TCPDF action by setting my file name via
$form->data['pdf_file_name'] = "My_File_Name"
before saving the pdf to the server.
Hope this helps someone else
My goal was to have a pdf sent as an email attachment and also allow users the ability to download it while keeping the same file name.
I used the TCPDF action to save the pdf to the server and to attach it to an email which works flawlessly.
However, the TCPDF assigns a date stamp to the end of the file name (to prevent overwriting) which resulted in a different name when trying to use this action for users to download too.
So, I figured I would be able to use the File Downloader to bypass this, but it does not work well with dynamic file names..
When nothing seemed to work, I took a look at the TCPDF code and found that if there already is a $form->data['pdf_file_name'] in the form data array, it will use that as the file name.😀
I was able to achieve my goal with the TCPDF action by setting my file name via
$form->data['pdf_file_name'] = "My_File_Name"
before saving the pdf to the server.
Hope this helps someone else
This topic is locked and no more replies can be posted.