Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:15:12+00:00 2026-05-26T18:15:12+00:00

My upload script doesn’t seem to store Korean characters into a database properly. $file_name

  • 0

My upload script doesn’t seem to store Korean characters into a database properly.

$file_name = $_FILES['Filedata'][ 'name' ];
$newFileName = time() . "-" . $file_name;
$target = $uploaddir . $newFileName;
$source_file_path = $_FILES['Filedata']['tmp_name'];
if( move_uploaded_file( $source_file_path, $target ) ) {
    $sql = "INSERT INTO images(file, album, author) VALUES('".$newFileName."', '".$albumID."', '".$authorID."')";
    $result = mysql_query($sql);
    if(!$result) {
        echo "Could not store into database";
    } else {
        $sql = "UPDATE albums SET `lastdate` = NOW() WHERE id = '".$albumID."'";
        if(mysql_query($sql)) {
            echo str_replace($_SERVER['DOCUMENT_ROOT'],'',$target);
        } else {
            echo mysql_error();
        }
    }
}

The weird thing is, it stores the file properly with the right name, but it adds all the unusual characters like “1321088842-ê°ì‚¬.jpg” into the database. The database is set to utf8_general_ci so I’m not sure what the problem could be. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:15:12+00:00Added an answer on May 26, 2026 at 6:15 pm

    You need to make sure:

    1. the database/table/column is using UTF-8
    2. the database connection is using UTF-8
    3. the web browser is using UTF-8 when you upload the file
    4. the web browser is using UTF-8 when you display the file to the user later on
    5. that all your development tools (eg: phpMyAdmin) are using UTF-8 when you view the database

    If there’s any point, anywhere along the way, where something isn’t using UTF-8 then things are going to go horribly wrong.

    Note that web browsers usually do not use UTF-8 by default. So you will need to either include a <meta> tag instructing it to use utf-8, or manually set them to use it (in my browser, with View -> Text Encoding -> UTF-8).

    Your php script is echoing the filename to the browser, but if it’s just echoing the filename without a <meta> tag the browser will be trying to display it as some other encoding, perhaps latin1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The upload script in this page is currently uploading the images to the same
So I have an upload script, and I want to check the file type
So I have my upload script working just fine, but now it's a matter
I have an upload script that write a index.html file, I modified it to
I've made an image upload script using the move_uploaded_file function. This function seems to
I'm working on a upload script and using move_uploaded_file() function. The problem is, that
Im making a small python script to upload files on the net. The script
I have a bash script to upload some files to my webserver. The problem
BACKGROUND I have a script to upload an image. One to keep the original
Drupal cannot create the files folder. I tried to upload a php script with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.