• 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: [RSForm Pro] Replace spaces in upload filenames

[RSForm Pro] Replace spaces in upload filenames 15 years 10 months ago #3214

  • renekreijveld
  • renekreijveld's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Thank you received: 7
I am testing RSForm Pro and the file upload option seems to work fine.
(Although sending the uploads with e-mail isn't working yet, see this thread).
I would like to suggest, that you replace spaces in file upload filenames with underscores.

This would make it easier to add working download link in e-mails to the uploaded file(s).

Thanks,
Webguy
René Kreijveld, Joomla! specialist
The administrator has disabled public write access.

Re:[RSForm Pro] Replace spaces in upload filenames 13 years 11 months ago #10539

  • as0r
  • as0r's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hey I"ve been trying to achieve the same thing... here is a solution i came up with:

go to you components/com_rsform/controllers dir download functions.php

and look for this string:
// 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];

and replace with:
// todo - customize prefix 
   $timestamp = uniqid('');
// todo - handle files through joomla 
   move_uploaded_file($tmp_name[$i],$dest[$i].$timestamp.'-'.str_replace(' ', '_',$name[$i]));
   @chmod($dest[$i].$timestamp.'-'.$name[$i],0644);
   $name = str_replace(' ', '_', $name);
   $file = $dest[$i].$timestamp.'-'.$name[$i];

This will convert the ' ' to '_'
Last Edit: 13 years 11 months ago by as0r.
The administrator has disabled public write access.

Re:[RSForm Pro] Replace spaces in upload filenames 12 years 7 months ago #14785

  • ctic
  • ctic's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Solution for rsform


//files
foreach($fields as $field){
if($field->inputtype=='file upload'){

$target_file = time().'_'.str_replace(' ', '_', $_FILES[$field->name]);
Last Edit: 12 years 7 months ago by ctic.
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!