Change Upload Directory Target for Custom Field File Upload .gpx File Type

This topic contains 6 replies, has 3 voices, and was last updated by  Stiofan O’Connor 7 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #376049

    Ed Shoemaker
    Buyer
    Post count: 11

    I have created a custom field for Upload File to support the upload of .gpx files. I have used WP Add Mime Types plugin to enable WordPress to accept the file type. Currently, when the file is uploaded, it is being sent to a temp folder created under /wp-content/uploads/2017… folder structure However, I need this specific file type to be sent to a different directory under /wp-content folder structure that is being used by a separate plugin (WP-GPX-Maps) – specifically, /wp-content/uploads/gpx.

    Any chance you can help me make the necessary modifications to support this customer requirement?

    Thanks in advance for the assistance!

    #376051

    Guust
    Moderator
    Post count: 29970

    I’ll get one of the developers to have a look at your question.
    It may be after the weekend, thanks.

    #376108

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Ed,

    If you can explain what you are trying to achieve maybe i can give better advice?

    You can use the hook “geodir_before_save_listing” to grab the info before it is saved, this would allow you to copy the file anywhere you want.

    Thanks,

    Stiofan

    #376142

    Ed Shoemaker
    Buyer
    Post count: 11

    Overview:
    The primary purpose of the site is to provide listings of bicycle routes (mountain bike and road bike) to site users. On the individual listings pages for the bicycle routes, we are using the WP GPX Map plugin (https://wordpress.org/plugins/wp-gpx-maps/) to present the route map. We have modified the listing page to present the route map at the top of the listing page.

    Current workflow requires (2 Step):
    1) Create Listing – When a listing is added via the Add Listing page, the GPX File Name is manually entered by user into a Custom Text Field (example file name “bike_route_map.gpx”)
    2) Upload GPX File – Separately, the .gpx map must be added to WP GPX Map plugin via WordPress Admin in the WP GPX Settings page, selecting the file “bike_route_map.gpx” and uploading it.
    ———-
    3) After to two steps above have been completed and assuming the file name references match for both steps, the GPX route data is presented in a map on certain listing pages.

    Comment: This workflow requires two separate actions to support the publishing of the .gpx file-based route map/data on the certain listing pages. We desire a more streamlined workflow that does not require someone with WP-Admin access to manually upload the .gpx file into the WP GPX Map plugin.

    Desired workflow (1 Step):
    1) Create Listing – When adding a new listing that will include a .gpx map file, the user would upload the “bike_route_map.gpx” file via a Custom File Upload Field
    ———-
    2) Upon Submitting the listing, the .gpx file is automatically saved or moved to the native .gpx file directory (/wp-content/uploads/gpx)
    3) We will have to modify our custom code to to reference the name of the .gpx file that has been uploaded

    Describing this in the abstract is a little challenging for me, so to help you get a better idea of what we’re talking about here, I will provide url and access credentials to the current dev site via a private message to follow. We apologize in advance for the messy appearance as we are in early stages of development. Additionally, we are primarily site builders with reasonable html and css skills, but are fairly “php-challenged”… 😉

    Thanks again for your consideration in helping us out with this. We really love GeoDirectory and the great support that you folks offer.

    #376145

    Ed Shoemaker
    Buyer
    Post count: 11

    Here’s a couple of additional screenshots that I missed on the last message.

    #376149

    Ed Shoemaker
    Buyer
    Post count: 11
    This reply has been marked as private.
    #376349

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I can’t get a pgx file to upload on my system for some reason (maybe a bad test file)
    But if it were me i would just grab the saved file url and pipe that into the plugins shortcode, this could be done by editing the output of the file custom field.

    Stiofan

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount