• 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 name prefix in submissions directory

File name prefix in submissions directory 3 years 4 months ago #41699

When I use the file upload field in a form, I'm using a code string in the prefix attribute to add the username as the filename prefix. However, when the user logs in and upload new files to their submission via the submissions directory, there is no prefix added. I end up with a bunch of files with no prefix. How can I add the username as a filename prefix when files are uploaded through the submissions directory?

This is the code I have in the Prefix field in the original form; I just don't know how to do this in the submissions directory.
//<code>
return $_POST['form']['FileNamePrefix']."_";
//</code>

THanks
Karen
The administrator has disabled public write access.

File name prefix in submissions directory 3 years 4 months ago #41701

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

The code you're using is taking the value of your "FileNamePrefix" field upon submit and adds it as the file's prefix. You'll need this particular field "FileNamePrefix" also being part of your Submissions Directory editing form page. If when editing the submission, this field and its value aren't available, then you won't have any prefix data being added.

Ensure the field in question was included as well, or use an entirely different PHP approach that doesn't rely on POST data.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

File name prefix in submissions directory 3 years 4 months ago #41704

Thank you! FileNamePrefix is a hidden field on the form, and you are correct, as soon as I made it Editable on the Directory, it added the prefix correctly to the file uploads. Since I don't want users to actually change it though, I just hid the field with CSS so they can't see it.
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!