I have an json file located in DAM path .
I want that file to be picked and I am using the content of JSON file to display dropdown
I am able to achieve it in the author instance but I am not able to fetch JSON file in publish instance
Here is the code :
Solved! Go to Solution.
Views
Replies
Total Likes
I'm glad this helped to find the root cause.
For the documentation around the filtering on the dispatcher take a look here:-
For a working example, you can refer to the wknd GitHub implementation,
it's not valid for this use case but also as a reference to your other implementation of AEM as Cloud based project. It's updated from time to time with new features implementation.
Something like this in your case:-
/0020 { /type "allow" /url "/content/dam/psg/hydro/listofChemicals.json" }
or a more generic one (recommended as it restricts the pattern)
/0034 { /type "allow" /path "<your path(s)>" /method "GET" /extension '(json)'}
Hope this helps!
Regards,
Nitesh
Hi,
In Publish instance check the access of DAM file? better to write some logs and check error logs.
Hi @arunpatidar
Thank you for your response
No I am not able to access DAM file in publish instance , it's throwing 404 error.
As @nitesh_kumar mentioned,
you need to write the dispatcher rules to allow json
Examples
Hi @rahul234dabas ,
Since this is an ajax call, check what error you see in-network tab.
Also, since this is AEM as Cloud implementation check your dispatcher rules if the JSON is allowed to be served. If yes then check if it's blocked for this path.
Hope this helps!
Regards,
Nitesh
Hi, @nitesh_kumar
Thank you for you response , seems like the dispacher rule is not written to allow json files , may I know how to write a rule to include json files?
I'm glad this helped to find the root cause.
For the documentation around the filtering on the dispatcher take a look here:-
For a working example, you can refer to the wknd GitHub implementation,
it's not valid for this use case but also as a reference to your other implementation of AEM as Cloud based project. It's updated from time to time with new features implementation.
Something like this in your case:-
/0020 { /type "allow" /url "/content/dam/psg/hydro/listofChemicals.json" }
or a more generic one (recommended as it restricts the pattern)
/0034 { /type "allow" /path "<your path(s)>" /method "GET" /extension '(json)'}
Hope this helps!
Regards,
Nitesh
HI @rahul234dabas ,
There can be multiple reasons for this issue
I hope it helps.
Thanks,
Rohit
It could be in error due to various reasons
1. Not published - you need to publish the JSON file and verify you can see them in publisher. Based on your replication config, there is a chance that its blocked there
2. Dispatcher filters - Like Arun mentioned, unless you allow JSON file access, it will be blocked. So need to ensure you have a valid rule to allow this file in JSON
3. URL rewriting - Based on how your URL rewriting definitions are, that can also pollute your request. If your /content/dam/ path is trimmed for better URL paths in the webserver, there is a chance /content/ is not allowed. Ensure this path is accessible OR update your JS to have a publisher calling path like your rule
Hi @rahul234dabas ,
Coud you please check if the path is present in "/content/dam/psg/hydro/listofChemicals.json" this needs to be replicated.
Post you need to allow "'/content/dam/psg/hydro/listofChemicals.json" file regex in dispatcher refer doc