Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-05-30 17:14:29

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

uploading images with special characters not working?

I thought I used to upload images by category. spend an hour trying to no avail. So then i decided to just upload the image to the main images directory. Again no luck. Tried again with a different image and it upload fine, even though i ended up deleting it. So then I decided to look at the file name––and an aha moment! The file name “Giro_D’Italia.jpg” had that pesky diacritic in it. Removed that and the file loaded just fine. Is this a bug?
PS will next try to load images by category.


…. texted postive

Offline

#2 2022-05-30 19:55:29

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: uploading images with special characters not working?

Can not reproduce, Giro_D’Italia.jpg uploads fine on my localhost.

Offline

#3 2022-05-31 00:39:45

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: uploading images with special characters not working?

As others, I can upload an image named like that on my OpalStack[*] hosted Textpattern install. Are you sure there are no (hidden?) characters in the file name?

[*] Host server config should be the same between their various servers AFAICT.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2022-05-31 05:42:58

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: uploading images with special characters not working?

phiw13 wrote #333461:

As others, I can upload an image named like that on my OpalStack[*] hosted Textpattern install. Are you sure there are no (hidden?) characters in the file name?

[*] Host server config should be the same between their various servers AFAICT.

i just uploaded the troublesome file’Italia_Poster2.jpg via SFTP just fine.

But notice that the file name is Giro_D’Italia_Poster2.jpg and in the url i pasted the wold “Giro” is not showing. it only shows https://bicilogic.com/files/Giro_D

also clicking on the link seems to bork the file name. it renders as “Giro_D” without the ‘Italia_Poster2.jpg

but this link works ie without using the textile way https://bicilogic.com/files/Giro_D’Italia_Poster2.jpg

edit: ps i am on OpalStack server

Last edited by bici (2022-05-31 05:47:30)


…. texted postive

Offline

#5 2022-05-31 06:33:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: uploading images with special characters not working?

I am not sure what is happening to your image. The URL gives me a 404 :-(

Here is a little test with an image and Textile links: emps.l-c-n.com/notebook/image-test-special-characters-edition. The image was uploaded with SFTP (the same image that was earlier uploaded correctly with Textpattern).

It is very possible that this little article disappears in a couple of days.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2022-05-31 08:16:12

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: uploading images with special characters not working?

That could be a Textile problem: "troublesome file":https://bicilogic.com/files/Giro_D'Italia_Poster2.jpg renders as troublesome file’Italia_Poster2.jpg. You’ll have to evoke Jukka’s spirit..

Offline

#7 2022-05-31 08:35:03

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: uploading images with special characters not working?

etc wrote #333466:

That could be a Textile problem: "troublesome file":https://bicilogic.com/files/Giro_D'Italia_Poster2.jpg renders as troublesome file. You’ll have to evoke Jukka’s spirit..

But as far as I can tell bici is using a or U+2019 not a straight single quote mark (U+0027). U+0027 would certainly create a problem for Textile.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#8 2022-05-31 08:46:55

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: uploading images with special characters not working?

Yeah, maybe, but I’ve copied the link from his post source.

Offline

#9 2022-05-31 11:40:29

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: uploading images with special characters not working?

Oh… did I misunderstand it all the time and bici is actually using a ' (U+0027) – “apostrophe” or straight single quote?

That would explain the upload failure. I tested right now: file'name.png. This silently fails unless one looks in the browser console:

Failed to load resource: the server responded with a status of 500 ()

Hmm, ok. Maybe I understand my confusion – Textile automagically converts the ' to in normal text runs… Disclaimer though, your first post notes Giro_D’Italia.jpg


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#10 2022-05-31 13:00:44

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: uploading images with special characters not working?

phiw13 wrote #333470:

Disclaimer though, your first post notes Giro_D’Italia.jpg

Because I have copied it from the textiled output. Ok, from few tests it looks like

  • uploading works fine
  • numeric txp image URLs are fine too
  • textile borkes

But txp itself does not store images under their original names, replacing them with a number. So this looks like a pure Textile problem.

Offline

#11 2022-05-31 16:02:23

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,075
Website Mastodon

Re: uploading images with special characters not working?

etc wrote #333458:

Can not reproduce, Giro_D’Italia.jpg uploads fine on my localhost.
yes it uploads via SFTP for me as well., It’s onlythe TxP imaghe uploads that borks and fails to upload.

the original file is found here (NOTE the fIle name): https://help.globalcyclingnetwork.com/hc/article_attachments/360019877238/Giro_D_Italia_Poster_1920x1080.jpeg

But when the image file is downloaded the file name on my computer changes to : Giro_D'Italia_Poster_1920x1080.jpeg

how is D_Italia changed to D'Italia ?? and this is the file that TxP fails to upload although SFTP has no issues.
mystery.


…. texted postive

Offline

#12 2022-05-31 17:58:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: uploading images with special characters not working?

bici wrote #333475:

the original file is found here … Giro_D_Italia_Poster_1920x1080.jpeg … but when the image file is downloaded the file name changes to : Giro_D'Italia_Poster_1920x1080.jpeg

You are absolutely right: the file name in the browser bar changes when you choose save. Here you can see them both together in one screenshot:

– https://imgur.com/bKMr4RQ

Presumably that character is the cause of the problem.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB