Timeline for How to change upload directory based on frontend form input name or ID?
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Dec 6, 2020 at 7:02 | history | bounty ended | CommunityBot | ||
S Dec 6, 2020 at 7:02 | history | notice removed | CommunityBot | ||
Dec 3, 2020 at 12:00 | history | tweeted | twitter.com/StackWordPress/status/1334467469705154562 | ||
Dec 3, 2020 at 9:49 | comment | added | user197754 | @SallyCJ, I'm not sticking to a plugin. If you know a way to do this using pure code, I'm open to it. I used a plugin called WPForms because it was convenient. | |
Dec 3, 2020 at 8:55 | comment | added | Sally CJ |
@user197754, if $_REQUEST doesn't contain the file data, then try with $_FILES , but as @Olivier said, you need to know the code (JS/PHP) used for uploading the file / processing it on the server. But are you sure $_REQUEST doesn't actually contain any data specific to the uploaded file (or upload form) - try var_dump( $_REQUEST, $_FILES ) ?
|
|
Dec 2, 2020 at 4:31 | comment | added | user197754 | @Olivier unfortunately there's none. I'm not sticking to a plugin either. I could use the WordPress hooks, just don't know how to filter this functionality based on input value. | |
Dec 1, 2020 at 17:16 | comment | added | Olivier | Since you are saying that the upload is handled by a custom plugin, it means you will need to check if that plugin can be customized with hooks. You will have to look in the custom plugin code to see where the actual file saving is happening to see if the process can be modified. | |
S Nov 28, 2020 at 5:23 | history | bounty started | AGMG | ||
S Nov 28, 2020 at 5:23 | history | notice added | AGMG | Draw attention | |
Nov 19, 2020 at 3:58 | history | edited | user197754 | CC BY-SA 4.0 |
I'm updated the question with code samples
|
Nov 19, 2020 at 3:10 | comment | added | user197754 | Thanks for the comment @TomJNowell Basically something similar to this: answer But instead of the file type, I need to filter based on input name or the id of a form. | |
Nov 18, 2020 at 20:56 | comment | added | Tom J Nowell♦ |
Uploads in WP create a post of type attachment , WordPress itself doesn't care about the location of the files, and there's no built in capability to restrict access to those folders as they're served directly by Apache/Nginx, so to talk about multiple locations doesn't make much sense. Since this isn't a discussion forum, and people need to be able to write a specific answer that fully answers your question, what kind of answer are you looking for? I notice there is no code in your question to work with, can you edit your Q to include it? What problem does this solve?
|
|
Nov 18, 2020 at 20:51 | review | First posts | |||
Nov 22, 2020 at 20:06 | |||||
Nov 18, 2020 at 20:45 | history | asked | user197754 | CC BY-SA 4.0 |