Skip Navigation

[Gelöst] Upload file field

This support ticket is created vor 6 Jahre, 9 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 Antworten, has 4 Stimmen.

Last updated by helenmaryC vor 6 Jahre, 7 Monate.

Assisted by: Christian Cox.

Author
Artikel
#542998

Hi

I am thinking about creating a File-Custom-Post type where I can add version information, description etc fields to the post type and then attach a file.

So I would like to put an upload file field on the post type.

But I would like the field to be uploaded in a different directory than the media files.

I have searched the forum, and it looks like this upload to a different directory is a feature requested many times but maybe not solved yet.

Do you have suggestion to how I will be able to handle this?

Kind Regards

Henrik

#543088

Hi, there's really no straightforward way to specify an upload directory in Types. One suggestion I can think of is to use a separate plugin that manage uploads and stores them in the directory structure you want. If that plugin offers an API, then we could try to copy the URL from the uploaded file into your custom field automatically using our own API. I don't know much about file upload management plugins so I really don't have a good recommendation for you. If it works for your uploads and offers a documented API, then we can probably integrate with it.

How would you like to proceed?

#543371

Hi Christian

Could you mark this as a feature request then?

If you search the support forum, you will find that there are plenty of questions from users who asks for how they can upload to a different directory than the media directory..

I found this post trom Tom, on how you can code it your self basically.

https://code.tutsplus.com/articles/attaching-files-to-your-posts-using-wordpress-custom-meta-boxes-part-1--wp-22291

It is a good tutorial and I might end up following Toms's example.

He use the wp_upload_bits() function which actually makes it possible to change the target location of the file, since you can enter that as the first parameter to the wordpress function.

I would prefer that this was actually part of the upload field settings in types. It is needed and I can see that ACF does not have this feature, so it would give Types an advantage.

This is actually the first project for hidden link which is a site where I will post solutions made with toolset to, as long with instructions on how to do it. And I need a files type library where I can describe the files, version number etc, and of course add the file to it. One file one post.

But in order to structure the files, I need to be able to control where they are uploaded to.

So I could really use this feature.

#543967

Okay thanks for the suggestion, I have forwarded this request to our developer liaison for their review.

#565159

Hello, at this time our developers have decided not to implement this feature. They feel that we should only upload files to the same directory where WordPress uploads files. Any additional manipulation of that process will require custom code. If you need professional help with this code, you can contact one of our certified partner contractors. Here is the list of our contractors:
https://toolset.com/consultant/

#588339

Hello Henrik,

Do you know why the links in your post are hidden? I'd like to see them. Are you maybe referring to an article by Tom McFarlin? I'd also like to see your other site.

I have been wanting this feature in Toolset for a long time. I think I have one or two posts in here about it.

/Jakob

#1078788

FYI Gravity Forms seems to have figured this out. They have a hook, gform_upload_path, that allows the upload path to be changed on a form-by-form basis. Info here: hidden link They, of course, do not allow for editing of custom post types, so you are still the go to for that function 🙂

Changing the upload folder is something which I would like to see implemented in Toolset as well. It is great to be able to allow users to upload files, but it will get to be a hot mess quickly if everything is going into the media folder directly. Allowing developers to designate where the uploads should end up would simplify website maintenance.

Thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.