Attachment to post

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Edson Quadros
Registered User
Posts: 30
Joined: Wed Sep 09, 2020 3:44 pm
Location: Brasil
Name: Edson Quadros

Attachment to post

Post by Edson Quadros »

I hope I'm posting in the right place.
Can someone help me?
I developed a very specific extension for my need and I have a problem.
I know there are settings for extensions that are allowed to attach files by dragging to the post area, but I haven't found any setting that prevents dragging folders.
I need a way to prevent users from dragging folders into the post area. Only files are allowed. Is there any way to check this for some event or even modify some file?
Thank you very much for the help and sorry for my English.
Sorry my English
User avatar
Forex Station
Registered User
Posts: 177
Joined: Thu Apr 06, 2017 2:26 pm
Location: Australia
Contact:

Re: Attachment to post

Post by Forex Station »

Edson Quadros wrote: Tue Jul 27, 2021 3:12 pm I need a way to prevent users from dragging folders into the post area. Only files are allowed. Is there any way to check this for some event or even modify some file?
Why is it an issue if users drag a folder into the post area? On my forum, when they do this, it will only upload the contents of the folder.

What issues does dragging an entire folder cause for you?
Highly-customized PhpBB board voted as one of the most influential trading sites in the world: forex-station.com 💬
User avatar
Edson Quadros
Registered User
Posts: 30
Joined: Wed Sep 09, 2020 3:44 pm
Location: Brasil
Name: Edson Quadros

Re: Attachment to post

Post by Edson Quadros »

As I mentioned, I have a very specific extension for my forum. This extension unzips the .rar file dragged into the post and processes the contents of the zipped file. If the user drags a folder with several .rar files, I will have problems. That's why I need a way to stop them from dragging folders. I've already noticed that there is no configuration for this, so if someone can give me a hint of which file does this check, I could modify it to check if it's a folder or file that is being dragged and try to prevent it.
Thanks again for the help.
Sorry my English
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Attachment to post

Post by Brf »

I am not sure what your concern is. Dragging a folder is the same as dragging its content files.
User avatar
Edson Quadros
Registered User
Posts: 30
Joined: Wed Sep 09, 2020 3:44 pm
Location: Brasil
Name: Edson Quadros

Re: Attachment to post

Post by Edson Quadros »

I still haven't been able to solve my problem if any user drags a folder with several files. Could someone give me a light on how to prevent the user from dragging folders allowing only files?
Thanks
Sorry my English
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Attachment to post

Post by 3Di »

Without being able to see your code and therefore your progress no one can give you an answer, also because it is almost impossible to determine with certainty if a folder is not a file, in JS, assuming you want to use JS. Everything is not clear here, you want to do something but you don't explain how you're doing it, no one has supernatural powers to be able to imagine your work and therefore give you an answer.

Anyway, I think this article is worth reading:
https://stackoverflow.com/questions/250 ... ing-droppe
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
Edson Quadros
Registered User
Posts: 30
Joined: Wed Sep 09, 2020 3:44 pm
Location: Brasil
Name: Edson Quadros

Re: Attachment to post

Post by Edson Quadros »

3Di wrote: Tue Nov 02, 2021 6:35 am Without being able to see your code and therefore your progress no one can give you an answer, also because it is almost impossible to determine with certainty if a folder is not a file, in JS, assuming you want to use JS. Everything is not clear here, you want to do something but you don't explain how you're doing it, no one has supernatural powers to be able to imagine your work and therefore give you an answer.

Anyway, I think this article is worth reading:
https://stackoverflow.com/questions/250 ... ing-droppe
Thanks for the answer.
In reality, my code won't interfere with anything I need. I need the phpbb system to recognize that a folder is being dragged and prevent it from uploading.
I checked the site that recommended me and I even managed to get it to recognize that it's a folder or file, but once I've dragged it inside, it seems like there's no way to stop the upload.
Again, thanks for the help.
Sorry my English
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Attachment to post

Post by 3Di »

3Di wrote: Tue Nov 02, 2021 6:35 am Without being able to see your code and therefore your progress no one can give you an answer
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Post Reply

Return to “Extension Writers Discussion”