[OzzModz] Change Attachment Name

[OzzModz] Change Attachment Name [Paid] 2.0.2 Patch Level 1

No permission to buy ($20.00)
This resource has been removed and is no longer available. The following reason was provided:
This resource has been deleted by XenForo Ltd. in line with our resource housekeeping criteria.
 
I would like the names of the attached files to retain their original name. For example, if I attach an image with the name of a dog1.png then I should store it with the same name, and do not change it to a random name of many characters that have nothing to do with what the image is.

I think this add-on allows you to rename the file after uploading it, which is a bit tedious having to do it every time you upload a file. Can't add an option for attachments to be stored under their original name?
 
@anon666
XF's attachments system stores and displays original file name out of the box.
What you are talking about is likely attachment hash. Are you using third party attachment add-ons or another attachment storage system?
 
installed and working:
  • (y) 301's built in to xf work
  • (y) image optimizer still fires (I use theme house addon with resmushit)
  • (y) Works with attachments on S3 using the xf adapter code
  • (y) buying from a non-English site was scary, but worked out ok. Used paypal for $2.50 fee.

Request:
  • it doesn't update the alt text to the new image name. Would be nice if it was optional to update it, and if none provided, use the new image name as a fall back
  • Would be nice if it also worked in the admin dash context as well, admin.php?attachments/ and as above, trickled into the post to update the alt text.
 
Last edited:
Are you using third party attachment add-ons or another attachment storage system?

No, I don't use add-ons related to attachments. What I mean is that when I access the folder where the attached files are stored (I only use image files), the name with which it is stored is something similar to a hash, a long succession of alphanumeric characters.
 
Seems there is maybe a problem with snogs/forms
  • ErrorException: [E_NOTICE] Undefined index: attachment_id
  • #0 src/addons/PB/ChangeAttachmentName/XF/Pub/Controller/Attachment.php(26): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/h...', 26, Array)
    #1 src/XF/Mvc/Dispatcher.php(352): PB\ChangeAttachmentName\XF\Pub\Controller\Attachment->actionUpload(Object(XF\Mvc\ParameterBag))
    #2 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Attachment', 'Upload', Object(XF\Mvc\RouteMatch), Object(Snog\Forms\XF\Pub\Controller\Attachment), NULL)
    #3 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Snog\Forms\XF\Pub\Controller\Attachment), NULL)

I am not shure, if that client has changed some code, will check this tomorrow.
 
Have changed

Code:
            if (isset($json['attachment'])))
            {

to

Code:
            if (isset($json['attachment']) && isset($json['attachment']['attachment_id']))
            {
 
To make this add-on perfect, there could be a button to change the name of the attachment without to edit the post before, please.
At least, when there is only one picture.
 
I have upgraded, but I still get oops, no access here:
/attachments/upload?attachment=XF%3AAttachment[17802]&type=post

Update: Maybe this is a problem with PostAsUser?

I have set now the permissions to change attachment name for own and all,
but the problem stays. The name is changed, but the error message needs now a click to come back to the thread; there I have to press F5 to see the changes in text, if any.
 
Last edited:
Top Bottom