Hook or filter for file uploads/attachments?
-
Hi! First off I just want to say I’m a huge fan of the plugin, so thank you!
I recently purchased the premium version for a site that needed file uploads, and I am having a bit of trouble adding a small custom feature to it. Since users upload a lot of files on this site and they all get automatically added to the media library, it clogs up the media library and media uploader. On this site, there iss actually no use for seeing these files in the library at all, as the purpose of the form is just to upload them onto a separate custom directory on the site and then e-mail direct links to the admin. It would be great if we could disable attachment generation altogether, but it seemed not to be possible.
My idea to remedy this was to create media categories and automatically assign the files uploaded from the user form to a specific category, so that they could be filtered out. I’ve got everything covered except I can’t find a way to target the files that are uploaded via HTML Forms specifically. Is there any action or filter I could hook my logic onto after the file has been uploaded and the attachment object generated? Or perhaps there’s some other solution I haven’t even thought about?
And a small secondary question; is there a cap on the number or size of uploaded files? Due to a form having a large number of fields, I’ve noticed that the uploads get cut off after a certain point. I’m unsure whether that’s because of the files and their individual sizes adding up and perhaps going over the upload_max_size or post_max_size limit, or if there’s some cap on how many fields you can have and send at once? I realize having this many fields is a bad practice to begin with and should probably be remedied in other ways, but for now I would just like to get an idea of what’s going on.
Thank you for your time.
- The topic ‘Hook or filter for file uploads/attachments?’ is closed to new replies.