How to set csv file to open in the browser instead of download on Site Ground account - csv

I have a simple code that save logs in a 'csv' file on the server.
When I navigate to from the browser to the folder where the file is saved, clicking the file download it instead of opening the file for view in the browser.
I have another site using the same code exactly on the same server, and clicking file from it, open the file for view in the browser.
I use the same browser for both sites, so it is not related to browser settings.
I've tried to change the file privileges, but it didn't help.
This site was originally with a different host, and I thought that moving it to the same host will solve it, but it didn't.
I've tried to talk with the support of the hosting provider, but they say that a developer should handle it.

Replacing the file ending to 'cvs' solved the problem, and opened the file in the browser without any other settings change.

Related

How to test HTML/CSS files from PC on mobile device

Here's the situation:
I have a folder on my PC containing a single HTML file, a CSS file, and an images folder. I've been testing it through the browser on my PC, but I wanted to run the same files off my Android to test on mobile. I zipped the entire folder, emailed it to myself, and then downloaded it and unzipped it on my Android. When I click on the HTML file I can open the page on the mobile browser, but it appears that the CSS file is not loading at all, despite all of the files still being in the same folder together on my phone. Is there an obvious problem I'm missing?
If the issue is coming from your phone and not the file, try to upload it on a free web host, like byethost, and open it directly trought internet.
You'll need to get your files into a web server.
If you don't have an external site you can use, you can still do it with a local web server. Depending on your OS, options for a local web server include IIS, Apache (via XAMPP on Windows), or even debug mode from an IDE like Visual Studio.
Next, get a tunnelling service like ngrok or localtunnel. When you run it, it will give you a temporary external website address that redirects to your local web server. You can then use your mobile device to test.

Website stuck caching old files

I am working on a website, but whenever I upload a new file to my hosting provider (BlueHost), I cannot get the new version of the file to load in any browser or any PC that I have. This happens with both images and html files. I have tried loading the updated page on multiple computers on my network, but they all show the old version of the files. The new files will load on my phone, but only on 3g. I tried connecting through an Open VPN connection and this did not fix the issue, I also have cleared the cache in chrome on the computer. Any idea what could be going on?
Check your .htaccess file. It might have server caching set up.

A Href .zip download redirects to Homepage

I zipped a file on the server and created a link using
Download 3D View
Now whenever the link is clicked I am being redirected to the Homepage. Is it possible that this is not working due to security reasons with the zip file itself since I compressed it on the server?
It seems it was a security reason which I solved simply by compressing the files on my local machine and than uploaded the .zip file to the server. It seems the server was applying security while compressing.

Adding a .htm file to an IIS website asks for username and password instead of displaying the page

This is probably a simple fix, but I am having trouble googling the answer. What I have done was make a copy of a page that is currently on the site and renamed it. So for example I made a copy of page1.htm and renamed it to page1temp.htm. Now when I try to navigate to page1temp.htm it won't display the page, but instead asks for a username/password. If I navigate to page1.htm it still works as expected. I'm not sure what I am missing here. I am using IIS on a Windows Server 2003 R2.
I'm not sure what I need to change in IIS to get the page to display properly. Any help or clues would be greatly appreciated.
Check the NTFS permissions of the file (for example, by right-clicking on the file in Windows Explorer and checking the Security settings). Compare the permissions for both files. Chances are that the user used for anonymous authentication of your web site (might be IUSR_something) has permissions to read one file but not the other.

How to force the download a file from a network share rather than editing the file there

I have a web page that is hosted in our local network. On my page I have a link to a document. The document is linked to a network share. If the user opens the file, edits it and then goes to save the file it overwrites what is on the share. When opening the file I want the user to download the file, so when they come to save it they do not have the option to save it back. How could I go about doing this?
Server side I have access to asp.
You need to create a link which when clicked, streams the contents of the file to the browser, rather than having a link to the files actual location. If you do this the user will be prompted to save the file somewhere locally.
I am not at my PC currently so cannot get you an example piece of code, but you need to send the response with the content type set appropriately. Look in to mime types for a pointer in the right direction.
The term "download" is misunderstood here. When we open windows explorer and copy a file from a network share to our local machine don't think it terms of "downloading" it, we are just copying it. To "download" usually refers to access some resource outside of our local network and pulling that resource into that network.
Hence to achieve your aim you need to convince the client that is not accessing a file that is a local network resource. You can do this by adding a Virtual Folder to the IIS site that points the appropriate folder in the network share. Change the URL to use a "http:" protocal pointing at the virtual folder in your site.
Now the users will get the file from your website rather than accessing it as a normal file on the network.
You can stream the file through a webpage to download the file instead of opening a network share.
See this for an example:
http://support.microsoft.com/kb/276488
You can also share a directory through your web server by enabling directory browsing.
IIS 6: http://blog.crowe.co.nz/archive/2006/03/18/603.aspx
IIS 7: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx