0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

さくらのレンタルサーバーで日本語ファイル名の画像が読み込めない!

Posted at

以前Next.jsでexport(SSG)して、MicroCMSをつかって画像最適化もする必要があったときに、画像のファイル名が日本語だとURLエンコードされてNext.jsで画像を表示できない問題がありました。
その時は下記の記事に書いてある方法で解決はしたのですが、サーバーによって違いがあるようでさくらのレンタルサーバーだと404エラーになってしまいました。
https://zenn.dev/yuto0623/articles/66408a970a8754

さくらのレンタルサーバーでは日本語ファイル名のファイルは参照できない?

どうやらローカルからサーバーにアップするときの文字コードに問題があるようでした。
私はFileZillaを使ってアップロードしていたのですが、設定を変えることによって解決できました。

FileZillaで日本語ファイル名のファイルをアップする方法

FileZillaのサイトマネージャーで文字コードの設定があるので、そこでUTF-8を強制を選択すれば無事に404エラーにならずアップすることができました。

終わり

サーバーによって問題がない場合もあり中々気付かなかったのですが、誰かの参考になれば幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?