Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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 ajoutée par Maha Laks
Date de publication: 2014/09/29
islam khalil
par 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
par 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
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?