Skip to main content
Topic: http://localhost/postman/pomdetail/import_data (Read 2474 times) previous topic - next topic

http://localhost/postman/pomdetail/import_data

Hello Guru,

I am a new bee and playing around. I have a registered ver 2.7.3 and trying to import data (csv) and I am getting following error
       http://localhost/postman/pomdetail/import_data
This error (HTTP 403 Forbidden) means that this program was able to connect to the website, but it does not have permission to view the webpage.

I tried the solution in topic https://phprad.com/forum/index.php?topic=1165.msg3644#msg3644
but problem is same.

Can you please help me to solve this issue.

Regards
Hemant

Re: http://localhost/postman/pomdetail/import_data

Reply #1
In your case the issue is with csrf token, phprad does not allow external application without permission to post data to it without a csrf token. Please make sure the token is parse to the link when trying to import a file through postman. You can open any add page in your browser, then view the page source. After that you scroll to the buttom you would see csrf_token copy it and add its parameters to you like and paste the token you copied. 

Re: http://localhost/postman/pomdetail/import_data

Reply #2
Hi Willvin,

Thank you very much for your guidance. I found the  csrfToken = '0b5137442259a507d5df64e9c0f17440' after checking the source code but not sure where I have to copy. In my project "Postman" I only have a list page  and "Import" button there.  I am trying to create a Dashboard site where user only has a option for import data(csv) and export reports.

Why I have to add manually CSRF Token and not taken care by IDE itself ?

Second query if the table is empty (no record) "Import" button does not display on page. If I want to add/import data very first time, how can I ?

I am a new bee and does not have good knowledge of PHP.

Regards.
Hemant

Re: http://localhost/postman/pomdetail/import_data

Reply #3
It is taken care by phprad app but if you are calling your phprad import link from another, application phprad deos not allow that, so an app calling a link actually has the permissions to do so. if you want to do that you have to add the code yourself. You need to pass the csrf toke as a get parameter. E.G thttp://localhost/postman/pomdetail/import_data?csrf_token=0b5137442259a507d5df64e9c0f17440

Re: http://localhost/postman/pomdetail/import_data

Reply #4
Hi Willvin,

Thank you very much for your reply and guidance.

I have create a project in PHPRad IDE itself. The project name is "POSTMAN" at present has only one table called "pomdetail" and list page create for this table with option to "Import Data" (CSV).   I am not calling any thing outside of PHPRAD IDE after publishing the project when I run the project in browser or in IDE I am getting the same error.

I will try with manually putting the "Token" detail as guided and will get back to you.

One more question
Do I need to update manually every time when I made changes to "Project" and publish it or just once?

Sorry for inconvenience.

Regards
Hemant

Re: http://localhost/postman/pomdetail/import_data

Reply #5
@erskinevillelpo‍ this Import Error (HTTP Error 403): Access to localhost was denied [Solved] (phprad.com) should have fixed your issue, if you are still getting the error it means you did not follow the instructions carefully. please share screenshots of the file \helpers\Html.php, use external file storage and share the link to the image here.

Re: http://localhost/postman/pomdetail/import_data

Reply #6
Hi Willvin,

Good morning.

As per instruction  trying to attaching screen shot of Error and html.php file from helper folder for your review, but I am getting following error --

      There was a problem during the uploading of Error_ImportData.jpg.
      The upload directory is full. Please contact an administrator about this problem.

Once again sorry for inconvenience.

Regards
Hemant

Re: http://localhost/postman/pomdetail/import_data

Reply #7
@erskinevillelpo‍ this Import Error (HTTP Error 403): Access to localhost was denied [Solved] (phprad.com) should have fixed your issue, if you are still getting the error it means you did not follow the instructions carefully. please share screenshots of the file \helpers\Html.php, use external file storage and share the link to the image here.
 @erskinevillelpo‍ that is why I said you should upload the image to an external file provide like Gmail and share the link here.

Re: http://localhost/postman/pomdetail/import_data

Reply #8
Hi Willvin,

Sorry for delay in sending the file as busy with day-to-day work.

Please download file from following link
erskinevillelpo.com\ErrorCode\helpers.7z

If you need the project file let me know. Happy to share

Please guide me

Regards
Hemant

 

Re: http://localhost/postman/pomdetail/import_data

Reply #9
@erskinevillelpo‍ you did not follow the instruction that was given here Import Error (HTTP Error 403): Access to localhost was denied [Solved] (phprad.com) to fix your issue, I can clearly say that is the cause of the error. From the file you sent I can see you did not do the modifications to fix the error. Please follow the instructions laid out there and your import would work, thanks.