Hi,
thanks for your post.
First I want to point out, that I have not changed the code that manages the file upload and creates the links in a very long time. So no changes here for Visforms 3.5.x
As nobody has reported a similar problem ever and because I think that using file upload fields in Visforms is quite common, I think this is specific of your website and does not really have all it's origins in Visforms. But one can never be sure.
I would like to clarify some thing.
If a file is uploaded Visforms only stores the relative path information to the upload folder and the name of the uploaded file (which was renamed during upload) in the database. These values are stored in the database in the following format
Code:
{"folder":"tmp","file":"2015_04150018_55d5e16ca8caa.jpg"}
So the first step to check would be, to look into your database, not through the Joomla! Administration, but the real database with a mysql admin tool. Open the #__visforms_n table where n is the form id (if you have only one form most probably 1). Find the column where the information of the upload field is stored. Its name is composed from the character F and the field id (for example F5, if the upload field has the id 5). You should find a string as mentioned above in that field. Check, whether the "folder" is stored correct there. (It should be tmp and not site/tmp).
So if the folder is already incorrect in the database, the problem is situated in the code that creates the values which are stored in the database. In this case, please let me know, because this would help me to locate the source of the problem.
If not you have to know that everywhere where Visforms displays links to the uploaded files, these links are built from the information stored in the database. So if you find a link mydomain/site/tmp but in the database the "folder" was only tmp for this uploaded file then, the problem is caused by the code, that dynamically creates the links.
If that is so, I think I can see one piece of code that might not always work exactly as expected and you could try the following. Find the file administrator/components/com_visforms/helpers/html/visforms.php and the function
in this file.
Replace
Code:
JUri::root() with JUri::base()
in this function (there are 2 occurences).
Does this solve the problem?
Are you sure, that the links in the receipt mails do not work, or did you just guess because the links displayed on the website are incorrect?
Please let me know, what you find out!!
Regards,
Aicha