Get URL of Uloaded File
I know I have done this in the past, but I cannot seem to get it to work.
I have a CF form which allows upload of a file to the server. On the form, the file upload field is named 'share_file'. I have the UPLOAD FILE action in the ON SUBMIT event and it is working fine. I need to capture the full URL of the uploaded file, and store that URL in a field on the DB.
I have a field in the DB named 'share_file_link', and it is on the form as a hidden field.
I am using the following custom code, running after the UPLOAD FILE action:
This is not working, even though (I believe) I followed my previous use of this.
Thanks!!
Rick
I have a CF form which allows upload of a file to the server. On the form, the file upload field is named 'share_file'. I have the UPLOAD FILE action in the ON SUBMIT event and it is working fine. I need to capture the full URL of the uploaded file, and store that URL in a field on the DB.
I have a field in the DB named 'share_file_link', and it is on the form as a hidden field.
I am using the following custom code, running after the UPLOAD FILE action:
<?php
$filelink = $form->data['share_file_url'];
$form->data['share_file_link'] = $filelink;
?>
This is not working, even though (I believe) I followed my previous use of this.
Thanks!!
Rick
Hi Rick,
This code is wrong:
You need to place a "debugger" action after the upload file action to find the correct path to the file's url under the data array, then you can use instead of the code above!
Regards,
Max
This code is wrong:
$form->data['share_file_url']
You need to place a "debugger" action after the upload file action to find the correct path to the file's url under the data array, then you can use instead of the code above!
Regards,
Max
This topic is locked and no more replies can be posted.