Dear Max & Greyhead and of course all others on this community,
As usual with Chronoforms everything is possible and the sky is the limit. So i already know that there is a good answer out there. I only don't know it myself. Haha.
Version: 4.0 RC3.4.1
I have a upload form which basically has 2 items in it:
Browse file to upload and a submit button!
In events: I have show html in the on load position and on the on submit i have:
Upload files with thank you message. The form is working brilliantly thanks to the hardwork of the dev.
But when i upload a file called test.png then this name will be changed on the server to 20120507105522_test.png
The problem is that my css file is looking for test.png in this specific directory. I need to be able to upload a new test.png which automatically replaces the existing. I am 1000% sure that this is possible in CFV4.
So basically the question is how to get rid of the numbers and the _ (20120507105522_) so that i will end up with just the original file name!.
PS: the numbers are random it changes every time(For everyone who was thinking it was fixed.)
Thanks in advance for the help!
As usual with Chronoforms everything is possible and the sky is the limit. So i already know that there is a good answer out there. I only don't know it myself. Haha.
Version: 4.0 RC3.4.1
I have a upload form which basically has 2 items in it:
Browse file to upload and a submit button!
In events: I have show html in the on load position and on the on submit i have:
Upload files with thank you message. The form is working brilliantly thanks to the hardwork of the dev.
But when i upload a file called test.png then this name will be changed on the server to 20120507105522_test.png
The problem is that my css file is looking for test.png in this specific directory. I need to be able to upload a new test.png which automatically replaces the existing. I am 1000% sure that this is possible in CFV4.
So basically the question is how to get rid of the numbers and the _ (20120507105522_) so that i will end up with just the original file name!.
PS: the numbers are random it changes every time(For everyone who was thinking it was fixed.)
Thanks in advance for the help!
Hi hennysmafter,
The good news is that they aren't random 20120507105522 is 2012-05-07 10:55:22 the string is added deliberately to avoid possible conflicts with uploaded files having the same name.
The bad news is that the standard Upload Files action doesn't let you change the file name to something different.
You can either use a Custom Code action to rename the file after the Upload Files action or you can try my Upload Files [GH] action which does allow you to set the file name.
Bob
The good news is that they aren't random 20120507105522 is 2012-05-07 10:55:22 the string is added deliberately to avoid possible conflicts with uploaded files having the same name.
The bad news is that the standard Upload Files action doesn't let you change the file name to something different.
You can either use a Custom Code action to rename the file after the Upload Files action or you can try my Upload Files [GH] action which does allow you to set the file name.
Bob
Dear Greyhead,
I knew it is possible! I have downloaded your action and it installed perfectly on the site.
I changed the form i have to the following:
ONLOAD: Show HTML
ONSUBMIT: Upload Files (GH)<== Your custom action
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: JOOMLA_PATH/images/clientlogo/
File name:{form_name}
But now nothing is uploading. What should i do!
Thanks for all the help!
With regards,
Henny
__________________________________________________
I have the form working but not how i would like it. I have changed the following
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: JOOMLA_PATH/images/clientlogo/
File name:{form_name}
to
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: /home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/images/clientlogo/
File name:logo
My client wants me to make a "quickstart" so that he can make his own site's easy. So I cannot use hardcoded url like /home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/ for that I was hoping I could use the JOOMLA_PATH but than it breaks. I hope you can help me with that.
Thanks for getting me so far.
I knew it is possible! I have downloaded your action and it installed perfectly on the site.
I changed the form i have to the following:
ONLOAD: Show HTML
ONSUBMIT: Upload Files (GH)<== Your custom action
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: JOOMLA_PATH/images/clientlogo/
File name:{form_name}
But now nothing is uploading. What should i do!
Thanks for all the help!
With regards,
Henny
__________________________________________________
I have the form working but not how i would like it. I have changed the following
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: JOOMLA_PATH/images/clientlogo/
File name:{form_name}
to
In upload files gh I have set the following settings:
Files: file_upload:png
Upload path: /home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/images/clientlogo/
File name:logo
My client wants me to make a "quickstart" so that he can make his own site's easy. So I cannot use hardcoded url like /home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/ for that I was hoping I could use the JOOMLA_PATH but than it breaks. I hope you can help me with that.
Thanks for getting me so far.
Hi Henny,
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Bob
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
Bob
Dear Greyhead,
May I PM you those debugger details. I don't want to publish my clients domain online.
Regards,
Henny
PS: I have changed my earlier post! The form is working now I only need to change
/home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/images/clientlogo/
to
JOOMLA_PATH/images/clientlogo/
to get the result I need! Because I cant use hardcoded code like /home/SSEU/domains/CLIE etc.
May I PM you those debugger details. I don't want to publish my clients domain online.
Regards,
Henny
PS: I have changed my earlier post! The form is working now I only need to change
/home/SSEU/domains/CLIENTNAME/public_html/SOMETHING/SS/JOOMLADOMAIN/images/clientlogo/
to
JOOMLA_PATH/images/clientlogo/
to get the result I need! Because I cant use hardcoded code like /home/SSEU/domains/CLIE etc.
Hi Henny,
Sure you can PM or email them to me.
Is everything working now?? I'm not clear from your post.
Bob
Sure you can PM or email them to me.
Is everything working now?? I'm not clear from your post.
Bob
No it is not working!
It only works with the hardcoded link but i need to have something like JOOMLA_PATH.
I PM you the details!
It only works with the hardcoded link but i need to have something like JOOMLA_PATH.
I PM you the details!
Just a question
I need to distinguish files in a way that I'm sure each one has got a unique name. I think the best way to do this is to append to filename the IP address, then date and time, then filename.
I knew the way to do this with Chronoforma version 3.1, now I fear I'm getting lost with the nuew version. Should i Configure filename in upload path in the way here below?
upload path: filename:$_Server[Remote_ADDR]...
thanks a lot
I need to distinguish files in a way that I'm sure each one has got a unique name. I think the best way to do this is to append to filename the IP address, then date and time, then filename.
I knew the way to do this with Chronoforma version 3.1, now I fear I'm getting lost with the nuew version. Should i Configure filename in upload path in the way here below?
upload path: filename:$_Server[Remote_ADDR]...
thanks a lot
Hi davidakis,
By default the standard Upload Files action prefixes the name with a date+time string including seconds. This should ensure the name is unique without the IP address.
If you want to build a custom File name then using my custom Upload Files [GH] action is probably the easiest way.
Bob
By default the standard Upload Files action prefixes the name with a date+time string including seconds. This should ensure the name is unique without the IP address.
If you want to build a custom File name then using my custom Upload Files [GH] action is probably the easiest way.
Bob
Thanks for the tip. I installed your Custom action and I'm trying to do this:
$filename = $_SERVER['REMOTE_ADDR'].'_'.date('YmdHis').'_'.$chronofile['name'];
That was the PHP snippet I used in the previous form and worked correctly with old CF version; In my case there is the possibility that two people at the same moment in two different locations send a file while using my form; that's the reason why I built the previous version appending IP address to date+time then filename ; that is what I want to do at the moment, and I'm trying. Any suggestion or alternative?
Thanks
$filename = $_SERVER['REMOTE_ADDR'].'_'.date('YmdHis').'_'.$chronofile['name'];
That was the PHP snippet I used in the previous form and worked correctly with old CF version; In my case there is the possibility that two people at the same moment in two different locations send a file while using my form; that's the reason why I built the previous version appending IP address to date+time then filename ; that is what I want to do at the moment, and I'm trying. Any suggestion or alternative?
Thanks
Hi davidakis,
Unlike CFv3 you can no longer use PHP directly in the File Name box. You can use PHP in a Custom Code action to build a value and use that in the box though. The method is exactly the same as in this FAQ about creating a dynamic email subject.
Bob
Unlike CFv3 you can no longer use PHP directly in the File Name box. You can use PHP in a Custom Code action to build a value and use that in the box though. The method is exactly the same as in this FAQ about creating a dynamic email subject.
Bob
At last for me it was simpler to solve my issue with a little hack on upload_files.php, line 130 - You can find this file following this path:
administrator/components/com_chronoforms/form_actions/upload_files/
then, on upload_files.php, I reached line 130 and I modified as below, adding only what I needed
Thanks to all
Davide
administrator/components/com_chronoforms/form_actions/upload_files/
then, on upload_files.php, I reached line 130 and I modified as below, adding only what I needed
$file_name = $_SERVER['REMOTE_ADDR'].'_'.date('YmdHis').'_'.$file_name;
Thanks to all
Davide
This topic is locked and no more replies can be posted.