Home › Forums › General Issues › ACF Extended – File Upload Appends Date
Hello Support,
How do I disable the appending of date stamp when uploading a file using ACF Extended File Uploader form.
Here’s the code generate from acf_form call in php.
<div class=”acf-file-uploader” data-library=”uploadedTo” data-mime_types=”” data-uploader=”wp”>
<input type=”hidden” name=”acf[field_6070a13339f92][64c2c98f55881][field_6070a133401c0]” value=”” data-name=”id”> <div class=”show-if-value file-wrap”>
<div class=”file-icon”>
</div>
<div class=”file-info”>
<p>
<strong data-name=”title”>
</p>
<p>
File name:
</p>
<p>
File size:
<span data-name=”filesize”></span>
</p>
</div>
<div class=”acf-actions -hover”>
</div>
</div>
<div class=”hide-if-value”>
<p> Add File</p>
</div>
</div>
If this is something that is done by ACF Extended then you need to contact the developer of that plugin. ACF Extended is not a product created by the developers of ACF.
Hard to tell because most of the code was stripped by the forum. Try reposting it using code tags available in the editor here.
Hi John, I was mistaken it’s not part of ACF Extended, but just ACF.
Here’s code and on the upload of a file it prepends a date stamp. IE 2023-07-28.Test.pdf.
acf_form(array(
‘post_id’ => $_GET[‘casenumber’],
‘post_title’ => false,
‘post_content’ => false,
‘field_groups’ => [15257],
‘submit_value’ => __(‘Save Communications’)
));
I don’t understand what you mean by “appending the date stamp”, what/where is this date stamp added?
Hi John, I know it’s unusually behavior. But in the attached images below, there is the edit field group with a file type. And the other image, is the result of uploading a file using from the front-end. It pre-appends the date for some reason?
If that date is not part of the file name before uploading it is not ACF that is altering the file name. This would be done with a WP filter, probably something in either the theme or some other plugin. ACF does not alter file names when they are uploaded.
I think you are looking for a filter on sanitize_file_name, but that’s just a guess.
Thank you John. I will look into the code base, I am supporting.
Just so you know, there are several ways in WP to modify a file name on upload. The hook I mentioned is just one of them and I don’t know them all.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.