ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

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
تم إضافة السؤال من قبل Maha Laks
تاريخ النشر: 2014/09/29
islam khalil
من قبل 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
من قبل 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
من قبل Kamatchi Panneer Selvam , Software Developer , Comtel General Trading LLC

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

 

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟