Notifications
Clear all

transfer current attachments in WpForo posts

5 Posts
2 Users
0 Reactions
65 Views
Posts: 3
Customer
Topic starter
(@jan-loseries)
Member
Joined: 1 week ago

Hello,

how can i transfer my current attachments in WpForo posts which have saved in

wp-content/uploads/wpforo/default_attachments/

to the wpForo Advanced Attachments strategy ?

I don't want unauthenticated users to be able to download files directly via the URL.

thanks

Jan

4 Replies
Posts: 4178
 Tom
Admin
(@tomson)
Famed Member
Joined: 9 years ago

Hi @jan-loseries,

I'm really sorry, but there is no way to do that. The default attachments are embedded as a simple HTML code in the content, there is no way to control that code in the content. The advanced attachments addon uses shortcodes so it can manage accesses during rendering the shortcodes.

Reply
Posts: 3
Customer
Topic starter
(@jan-loseries)
Member
Joined: 1 week ago

Thanks Tom, but I can't accept your answer as a programmer. I am a programmer myself and I know that there is always a possibility of migration. Here is a screen to illustrate the situation visually. The marked element comes from your plugin and the two attachments directly above the DOM before the installation of your plugin. Is there no possibility of a migration that I can migrate the old attachments into the system logic of your plugin before the installation of your plugin? It can't be that I am the first one who wants to migrate old attachments ? My basic concern is to prohibit attachments via a direct url call of attachments if you are not logged in. Are there any alternatives ? With wpForo alone it is probably not possible. It would be very cool if you do not reject this idea from the outset and you can help.

Bildschirmfoto vom 2024 06 10 10 40 51

 

Reply
1 Reply
 Tom
Admin
(@tomson)
Joined: 9 years ago

Famed Member
Posts: 4178

@jan-loseries,

I'm sorry but there is no way. Each attachment should be found in post contents, then inserted to the database to get ID, then the ID should be used to generate shortcode, then the file should be moved to correct folder and so on... There is no such tool doing that. 

BTW you're showing the rendered HTML in the screenshot. All attachments of the addon are saved as shortcodes in the database and they are being rendered to the HTML on fly. If you go and check the database wpforo_posts table you'll see they look like this:

[ attach ] 234 [/ attach ]
Reply
Posts: 3
Customer
Topic starter
(@jan-loseries)
Member
Joined: 1 week ago

okay I give up ... is too much time I would have to spend writing a migration ... I thought you already had such a case ...

last question:

why the the new attachments links for example an PDF is not viewing in browser instead it always downloads ?

Reply
Share:
Scroll to top