Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Import Error (HTTP Error 403): Access to localhost was denied [Solved] (Read 3789 times) previous topic - next topic

Import Error (HTTP Error 403): Access to localhost was denied [Solved]

If you are having an Error 403: Access to localhost was denied when importing CSV/JSON files in phprad, just follow the below steps to solve it.
Locate and open \helpers\Html.php with a file editor and change Line 373 from this
Code: [Select]
<form method="post" action="<?php print_link($form_path) ?>" enctype="multipart/form-data" id="-import-data" class="modal fade" role="dialog" tabindex="-1" data-backdrop="false" role="dialog" aria-labelledby="myModalLabel">

to this
Code: [Select]
<form method="post" action="<?php print_link($form_path) ?>?csrf_token=<?php echo Csrf :: $token; ?>" enctype="multipart/form-data" id="-import-data" class="modal fade" role="dialog" tabindex="-1" data-backdrop="false" role="dialog" aria-labelledby="myModalLabel">

If after doing the above and you are still getting same error, confirm you have given current user role access to import on that page. you can follow this thread here https://phprad.com/forum/index.php?topic=111.0 for more details.
And you are good to go, enjoy ;) .