[wp-trac] [WordPress Trac] #44156: REST API: Media uploads ignore CJK/emoji chars in filenames
WordPress Trac
noreply at wordpress.org
Sat Aug 11 19:37:54 UTC 2018
#44156: REST API: Media uploads ignore CJK/emoji chars in filenames
--------------------------+------------------------------
Reporter: 0mirka00 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.9.6
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by kadamwhite):
@0mirka00 I am unable to reproduce this issue. Could you provide more
information about your environment -- WordPress version, operating system,
browser, server information, information about the client or mechanism you
are using to POST the file?
I was able to correctly upload a media file using both the `wpapi` JS
library, and via curl. Tested commands:
{{{
const path = require( 'path' );
const WPAPI = require( 'wpapi' );
const site = new WPAPI( {
endpoint: 'http://core.local/wp-json',
username: 'admin',
password: 'password',
} );
site.media().file( path.join( __dirname, '時間.jpg' ) ).create().then(
resp => console.log( resp ) );
}}}
{{{
curl --user admin:password -F 'file=@/home/kadam/tmp/バグ.mp3'
http://core.local/wp-json/wp/v2/media
}}}
Japanese filenames were correctly passed into the returned title field for
both JPG and MP3 payloads, tested with both kanji and katakana in the file
name.
A potential related issue I saw was that uploading an MP3 caused the
creation of an untitled image containing the cover art of the uploaded
MP3. This did not happen after renaming the same MP3 using a non-CJK
filename. Have you observed anything of this sort on your side?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44156#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list