• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: File renaming of uploaded files

File renaming of uploaded files 13 years 8 months ago #11234

  • mlb24usc
  • mlb24usc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
RS Form Pro has always added a prefix to file names once they are uploaded using the built in upload component. There was a fix to preserve the original file name that worked up until 1.3.0:

Original code in functions.php file:
// todo - customize prefix
$timestamp = uniqid('');
// todo - handle files through joomla
move_uploaded_file($tmp_name[$i],$dest[$i].$timestamp.'-'.$name[$i]);
@chmod($dest[$i].$timestamp.'-'.$name[$i],0644);
$file = $dest[$i].$timestamp.'-'.$name[$i];

Fix to diable file renaming:
// todo - handle files through joomla
move_uploaded_file($tmp_name[$i],$dest[$i].$name[$i]);
@chmod($dest[$i].$name[$i],0644);
$file = $dest[$i].$name[$i];

The folder / file structure has changed with 1.3.0 and I have yet to figure out how to prevent the renaming of files. Has anyone figured out a solution on how to preserve the original file name? Thanks!
The administrator has disabled public write access.

Re:File renaming of uploaded files 13 years 8 months ago #11235

  • mlb24usc
  • mlb24usc's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I've managed to figure this one out. The file that needs to be edited is located at ./administrator/components/com_rsform/helpers/rsform.php. Scroll down to line 1172 and delete $prefix. The line when completed should read.
$file = $realpath.$files['form']['name'][$fieldName];

Hope this helps somebody.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!