المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ووردبريس WordPress جسون JSON حل مشكلة you are not allowed to upload this file type



Rise Company
09-05-2023, 11:45
ووردبريس WordPress جسون JSON حل مشكلة you are not allowed to upload this file type
How to Upload JSON File to WordPress? [2023]
Allow .json upload file in WordPress
How To Allow JSON File Uploads In WordPress
How to Upload JSON to WordPress - wordpress .json” has failed to upload.
How to Fix “Sorry, This File Type Is Not Permitted for Security Reasons” Error in WordPress
How to Fix the Invalid JSON Error in WordPress

https://www.rise.company/upload/uploads/168362508294781.png

سبب المشكلة :

لا يوجد مشكلة نهائيا بموقعك , لكن الووردبريس بشكل افتراضى لا تقبل رفع ملفات json
لانها غير شائع استخدامها وكذلك يمكن من خلالها رفه ملفات بها اكود تضر بموقعك
لذلك هى معطله بشكل افتراضى.

Go to “Media > Library” section in your WordPress admin panel and try to upload a .json file. You will see an error mentioning, “Sorry, you are not allowed to upload this file type”. WordPress restricts uploading certain file types like SVG and JSON due to security reasons. As these are text files, the uploader can easily add malicious code in the file to harm your site. However, sometimes you may create the JSON file yourself or know the file is from clean source. In these cases, you can manually enable JSON upload either for processing the file or allow users to download from the frontend.

When uploading a file, WordPress checks its MIME type to allow or restrict the upload. WordPress has a list of allowed file types as listed in this official codex documentation (https://codex.wordpress.org/Uploading_Files) and .json is not the allowed format. So, you have to manually add the MIME type for JSON for allowing the file uploads through admin panel. Otherwise, you can directly upload the file on your server using FTP (https://www.webnots.com/how-to-setup-wordpress-ftp-account-in-bluehost/).

حل المشكلة :

Allow JSON Upload Using a Plugin

This is the best option to upload JSON files in your site.
Install and activate “WP Extra File Types” plugin on your site.

https://www.rise.company/upload/uploads/168362527634671.png

رابط البلوجن من هنا
https://wordpress.org/plugins/wp-extra-file-types/

بعد التثبيت اذهب الى settings ثم Extra File Types

https://www.rise.company/upload/uploads/168362584847261.png

ثم ابحث عن json واختاره ثم save
ثم اذهب الى media عادى وارفع الملف

https://www.rise.company/upload/uploads/168362584848872.png

ولن يقابلك اى مشكلة وبعد الانتهاء ننصح بتعطيل هذه plugin لمزيد من الامان
لتفادي احتمالية رفع ملف جسون به كود تجسس ان يزرع على موقعك

ملحوظة :
قد يمكنك رفع الملف ايضا من خلال بعض plugins / themes
التى بها import و export للاعدادات الخاصة بها

وهناك طرق اخري من خلال اكواد لا ننصح بها
لانه البلوجن اسهل حيث بعد الانتهاء من رفع ملفاتك تستطيع تعطيله بمنتهى السهولة

المرجع:
https://www.webnots.com/how-to-upload-json-files-in-wordpress/