I am trying the sample code below.
https://learn.microsoft.com/ja-jp/azure/storage/blobs/storage-upload-process-images?tabs=javascript%2Cazure-powershell
I was able to move locally.
(Start URL: http: // localhost: 3000)
We are deploying the code to Azure Apps Service as a Zip file.
However, even if I access the site URL, it cannot be operated.
(Start URL: https: // {azure apps service} .azurewebsites.net)
I'm wondering if I should set Web.Config, but I don't know what to write.
If you know what to set in WebConfig with the above code, I would appreciate it if you could tell me.
Also, if there is a solution other than this, I would appreciate it if you could tell me that as well.
I have followed the document which you have provided and it is working fine for me.
I am able to upload images and check them in storage account.
"You do not have permission to view this directory or page."
The root reason can be there is no default page in your Azure website.
when you deploy the zip file via the azurewebsites.net/ZipDeployUI, make sure that you see the files being unzipped on the /wwwroot level.
If the files show up under /wwwroot/your-app-folder/ you may get this permission issue.
You could directly view the page with url.
https://{siteanme}.azurewebsites.net/views/yourpage.html
Add the default document in the project root folder and set it as default page in appsetting on the Azure portal and save the setting.
The default document is the web page that is displayed at the root URL for a website.
Navigate to KUDU url: https://<your app name>.scm.azurewebsites.net/DebugConsole and go to site\wwwroot to check if the files are contained within a directory.
If you find any files missing , re-deploy the app.
OR
Just for checking Temporarily, drag the local files directly to the d:home\site\wwwroot directory and try again.
For debugging purposes you can turn on the Azure detailed messaging.
Login to Azure > App Services > Your Web App > App Service logs , then turn on Detailed Error Messages or turn on all of the logging options.
Add the below in your Web Config file,
add <customErrors mode="Off" /> BEFORE system.web closing tag, </system.web>. Similarly, add <httpErrors errorMode="Detailed"></httpErrors> BEFORE </system.webServer>.Upload the Web Config to Azure.
This will show the error messages in detail , from there you can figure out the exact issue.
Please refere SO thread for more details.
Related
I am working on a website using VueJS and just figured out how to do url parameters, which works well on my local machine. I can navigate to a page, and copy the full link including parameters in my browser and the page loads the same way.
Example: I type localhost:8080 to load the index site, navigate to localhost:8080/param1/param2 to go to another site, everything works fine. I can even type in localhost:8080/param1/param2 DIRECTLY (without going to index page first) and it works too.
However, after a build and upload to my web hosting provider, I can not type in the url with parameters DIRECTLY, it only works when navigating from index page.
I can the following error:
404 Error
I have almost no experience with routing and web hosting and even after extensive research could not find a solution online. Any help would be greatly appreciated.
Additional information based on comments I've received:
Web host:
I have a login to Plesk where I can manage my settings. There I have "Apache & nginx" settings which look like this:
Apache Settings
nginx Settings
This is due to the fact that SPA's do not have different HTML pages for different URL's like conventional pages. So, you have to either redirect all the requests to the index.html page in the server settings or set the history property to this history: createWebHashHistory().
Let me know if this works.
P.S: Sorry I don't know how to configure the settings for this in Apache or Nginx
I have application writen in node webkit.
I have three pages: login screen login.html , dashboard.html and
page that is downloaded from server, unpacked from zip and fired by window.location.href from local directory.
This is the main functionality of application, give user ability to login to repository of applications and get the latest code of "game".
In login.html and dashboard.html node js is working properly. Login app uses window.location.href to load dashboard after sucesful login. The problem is that another page, loaded from local directory has problems with "require". Does someone knows why in first pages require is function, and in another is not.
There is node-remote package, but this page is not loaded from remote server. This page is loaded from local storage.
Am i misiing some behavior of nodejs. Is NodeJS code and all pages compiled on application start? or they are added to object of nodejs.
The answer is pretty simple. NodeWebkit uses folder where are stored and executed my html files as root folder. I moved html to app root, changed src of app.js and everything works great. From that place node-modules are visible for application.
Its funny that someone like me, without knowledge of basics in node, can make advanced desktop app, remote server for it ...
I have a ASP.MVC app running in my company's domain. I would like to make links to Word, Excel or even to folders. For example I would like to allow user to access a project folder on public drive or Office document. Files and web app are on different servers, but in same domain.
The problem is that all modern browsers block access to local files. (Chrome throws an error saying "Not allowed to load local resource: file://..."). IE we are currently still using does allow that, but I can't rely on this.
How to tell the browser that it is safe to open those links?
I read about an option to serve .url files to user with link to file/folder. The downside is that I'd fill users temp folders with .url files. And also while I was testing this, I couldn't make changes to .url file after I saved it. Even removing the file doesn't help. It looks like windows stores it somewhere.
Another option was to make an a-tag with href like "data:text/plain;charset=utf-8..." and offer user to download .url file that way. But it was somehow not working for me.
Please help.
Thank you.
I have a single html file (index.html) and an image that I tried to host on Azure.
I put them in a dropbox folder and synced, the website got published and Azure status shows running.
I go the webpage and it shows:
You do not have permission to view this directory or page.
Do I need to add anything to make the site work?
You do not have permission to view this directory or page.
In general, when you access your web app : https://{webapp-name}.azurewebsites.net directly, you'd better make sure that the default documents you defined of your web app could be found within your web app. You could leverage KUDU or Azure App Service Editor to check whether your files exist.
#Dai No in Kudu I don't see the files...no index.html and my image file is there.
As I known, Azure would sync the changes (e.g add/remove file(s) in your DropBox deployment repository) and deploy the changes to your web app.
Note: When you delete file(s) synced from DropBox under your website folder(e.g D:\home\site\wwwroot\), the deleted file(s) couldn't be synced from DropBox in subsequent deployments. You could log into Azure Portal, choose your web app, select "APP DEVELOPMENT > Deployment options", check your deployment logs as follows to see the synchronization log.
According to your description, I assumed that you could log into Azure Portal, disconnect your deployment options and setup your DropBox deployment again. Also, you need to check the synchronization log mentioned above and check your files in your website folder via KUDU or Azure App Service Editor.
I have created a webapp using JSP,Html and Javascript which currently runs on my localhost using apache webserver. I want to display the files and folders and of a directory in local computer. I also want to create a download link or view link of those so that when anyone click on it it will be viewed in new tab or become downloadable as it happens in any ftp server. I know similar type of question has
been asked but none of them worked for me.
To create the download link I used
Download
this does not work as it is not in my webapp path and download attribute also does not work in internet explorer.
I'm not sure why you are exposing your local drive contents on the web but here's an option:
On the page that should display the files, in java code, list all
folders and files then for each file/folder show a link to some page
(for example "navigateLocalDrive" that sends the path of the clicked
file/folder like this:
Download
Now in that jsp, check if the GET variable is a path for a file or a directory,
if its a file, just send it back in the response, if its a
directory, list all files/folders and do the same as in step 1
Please note:
How I encoded the file path in the href in order to work properly.
The Access permissions for the webserver should allow write/read to that path (I'm already doing it on my Tomcat server on local host with the default setup no change needed)
For your reference, here are some helpers for this task:
How to list contents of a server directory using JSP?
Downloading file from JSP/Java
I am not sure if this is possible. In general the access rights are limited to the src and webContent Folder (for your html coding mentioned above for sure) . This is also reasonable, because you do not want to access or change data on your Computer in general, because after local development you want to deploy your web application to a server.
To make a test copy some file to the webContent and you will be able to download it. Within your Java coding you can use some IO package like java.io.File to navigate over folders and files. However keep in mind, that you will get some exceptions like
java.io.FileNotFoundException: C:\WeatherExports\export.txt (Access is denied)
if you want to access files outside the server.