Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to upload and download arabic file with same name using php and mysql?

<p>how to upload and download arabic file with arabic file name using php and mysql?</p>

user-image
Question added by Maha Laks
Date Posted: 2014/09/29
islam khalil
by islam khalil , Technical Manager , iCloudit

There is now problem with that , could you explain where is your problem ? 

To upload files :

http://www.w3schools.com/php/php_file_upload.asp

 

You can save those data to DB , and insure are in Arabic please use UTF-F encoding 

 

 

Renjith Chacko
by Renjith Chacko , Offshore Web Developer , Design Master

Generate a unique filename with date and time for each uploaded file

Rename the uploaded file with the newly generated name.

Save the original filename and extension in another column in the same table row within the database. 

 

Then for downloading/fetching you can easily retrieve the original filename with extension from the table and display it to the user.

 

Thus if two files are uploaded with the same name, you dont need to create name1, name2 etc and it wont overwrite the original.

 

If you need to store the filenames in MySQL, make sure you are having proper table and column collations, like utf8_unicode_ci. 

 

execute these sql when u initial ur connection:

 

$this->execute("SET character_set_client=utf8"); 

("SET character_set_connection=utf8"); 

("SET character_set_database=utf8"); 

("SET character_set_results=utf8"); 

("SET character_set_server=utf8");

Kamatchi Panneer Selvam
by Kamatchi Panneer Selvam , Software Developer , Comtel General Trading LLC

Before Executing SQL Query use this mysql_query("SET character_set_client=utf8")

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.