I am requesting an image in the Dojo Request and it is appending ?wab_dv=2.6 in the url and failed to query in the custom widget..
CORS Issue.. Added the new URL in the proxy.config and using Proxy.ashx.
I deployed my files in the IIS and client is running web app builder using Node.js.. so unable to access the external URL.
Thanks for the help and highly appreciated.
Cheers,
Srikanth Dasari
Srikanth,
What does your esriRequest url look like Extactly?
The WAB env.js has some tests it does on url to determine if it appends the WAB version to the url.
Here are the conditions that it will not append the deploy version to:
Thank you.
I kept one more condition in env.js file to access shared path and as a security concern images are not keeping in the IIS.
Here is the url for the image which is not accessible in IE ..
Url: \\NetworkDrive\TestImages\Image1.jpg
And chrome is showing the below error.
Failed to load file://sdasari-spro/TestImages/DSCN0031.JPG: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.l @ init.js:14120:49:28.646 init.js:141 Failed to load file://sdasari-spro/TestImages: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Please suggest me on this and would be highly appreciated.
Cheers
Can you modify this function appendDeployVersion in env.js?
and as a security concern images are not keeping in the IIS
Can you elaborate on security concern. There is no security concern when having images in a network shared folder that is setup as a virtual directory in IIS.
If you were using a virtual directory in IIS then you would not have this issue at all. You can also add a check to the env.js appendDeployVersion function as Jushan is talking about.
for example:
if(/^http(s)?:\/\//.test(url) || /^\/proxy\.js/.test(url) || /^\/\//.test(url) || /^\\\\/.test(url)){
But I really wish there was just a way to turn this feature off as I have had to modify this function before myself to look for query in the url:
if(/^http(s)?:\/\//.test(url) || /^\/proxy\.js/.test(url) || /^\/\//.test(url) || /\/query$/.test(url)){
Which I don't think is good practice for a widget developer to have to tell their users they have to modify a core WAB file just to use their widget.
junshan_liu-esristaff
Hi Robert,
Thanks for the help and I suggested virtual directory in the IIS. Now the PROBLEM is client is running web app builder using apache and we deployed/created the virtual directory in IIS.
Then I am getting the error while accessing the image is
1. OPTIONS https://hoeapp133/PhotosphereImages/images/ 404 (Not Found)
2. Response for preflight has invalid HTTP status code 404
Modification not required in env.js with the deployment in the virtual directory.
Thanks & Regards,
Are you specifying a specific image in the url?
Image and as well as the folder...
http://servername/VirtualDirectory/images
http://servername/VirtualDirectory/
OK, both of those urls are directory urls and unless you have set the Virtual Directory to allow directory browsing and you add code to deal with the return of that then you are not going to get anywhere.
I agree with you Robert. How about set the deployVersion = “” if your widget wants to disable this feature?
Thanks,
Junshan Liu
Esri R&D Center Beijing
19th Floor, Phoenix Place Office Tower A, 5A Shuguang Xili
Chaoyang District | Beijing 100028 | China
T (86 10) 57302700
junshan_liu@esri.com<mailto:junshan_liu@esri.com> | esri.com
The Science of Where
Thriving in China, Empowering the World
发件人: Robert Scheitlin, GISP
发送时间: Tuesday, December 12, 2017 7:53 PM
收件人: Junshan Liu <junshan_liu@esri.com>
主题: Re: - Re: DojoRequest in Web app builder
GeoNet <https://community.esri.com/?et=watches.email.thread>
Re: DojoRequest in Web app builder
reply from Robert Scheitlin, GISP<https://community.esri.com/people/rscheitlin?et=watches.email.thread> in Web AppBuilder for ArcGIS - View the full discussion<https://community.esri.com/message/735630-re-dojorequest-in-web-app-builder?commentID=735630&et=watches.email.thread#comment-735630>
Robert,
Life is revolving around the ESRI issues...
For resolving the CORS Issue, I tried with Proxy.ashx file and unfortunately client is using Proxy.js file.. then i configure the url's in the authorizedCrossOriginDomains in the config.json.... including port number
See the below example process flow and sample URL's
http://server1:3344/webappbuilder/apps/3 -----> trying to access the files residing in IIS --------> Virtual Directory which is http://server1//VD/Images
1. Enabled Directory browsing
2. Added Access-Control-Allow-Origin, Access-Control-Allow-Headers for the VD in IIS.
3. authorizedCrossOriginDomains:['server1:3344','server1:443']
Am i missing anything else....
You just need to educate the client that running WAB Dev is good for development purposes but when development is done the app needs to downloaded and deployed to web server for production and then proxy.js is no longer an issue and the proxy.ashx will be used just like you have.
Client Environment is up and running... we can't change in the current situation...End users are using the application..
Any workaround for the above query...
I don’t know of a way to resolve the access issue then. What is boils down to is the client is not using the environment as it is intended and you as the consultant/developer need to make them understand.
I am not in the client location since beginning and someone else setup the environment...
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.