I use my form to upload multiple images onto the server into a set location. At present I set this under the 'File Upload Setting' tab here you can insert a path for your uploaded files "/home/******/public_html/images/articleimages/ . This works fine, however I would like the flexibility to set the file upload path dynamically in the form. Is this possible?
Hi ugly,
The file upload code is executed very early on in the form submission work flow so you can't easily change the path without hacking the code.
What you can do is to move the uploaded file to another folder though. Using the Joomla JFile methods you can do this in the OnSubmit code in a few lines.
Bob
The file upload code is executed very early on in the form submission work flow so you can't easily change the path without hacking the code.
What you can do is to move the uploaded file to another folder though. Using the Joomla JFile methods you can do this in the OnSubmit code in a few lines.
Bob
Hi,
Yes, this is possible with a little creative coding. I posted a workaround some time ago to allow uploads to go into separate directories for each user. The trick is to use the uploaded file name code to add a path into the filename. This path has to be relative to the upload directory, and you should be very careful when coding this, as this could possibly allow users to upload potentionally bad files to replace key files in Joomla... A good start is to not allow the user to enter the url him/herself, but use their user details (such as ID, which a user cannot change themselves) to build the path, or provide a list of pre-defined locations (ignoring anything but these locations), etc.
Let me know if you hae any problems locating my old post, and I'll se if I can't find it...
/Fredrik
Yes, this is possible with a little creative coding. I posted a workaround some time ago to allow uploads to go into separate directories for each user. The trick is to use the uploaded file name code to add a path into the filename. This path has to be relative to the upload directory, and you should be very careful when coding this, as this could possibly allow users to upload potentionally bad files to replace key files in Joomla... A good start is to not allow the user to enter the url him/herself, but use their user details (such as ID, which a user cannot change themselves) to build the path, or provide a list of pre-defined locations (ignoring anything but these locations), etc.
Let me know if you hae any problems locating my old post, and I'll se if I can't find it...
/Fredrik
Friends
I'm completely lost.
I need to validade a username and password (in a table) and redirect the upload path to a field in my table. Any help? (I'm newbie in Joomla programming)
Thank you
I'm completely lost.
I need to validade a username and password (in a table) and redirect the upload path to a field in my table. Any help? (I'm newbie in Joomla programming)
Thank you
Hi
I think I'm close.
If I use the following code in before sending email it works
Now I only have to get a table field , or a session variable, with the path
I think I'm close.
If I use the following code in before sending email it works
<?php
$searchpath = 'c:\delphiphp\enviar\lixo\';
$MyForm->setFormParam('uploadpath', $searchpath );
?>
Now I only have to get a table field , or a session variable, with the path
This topic is locked and no more replies can be posted.