Azure CDN Correct URL Is Pointing A Wrong Resource - asp.net

I wrote a website with Blazor and because I and my server are in Australia. Most of my friends who want to contribute to my website are in China so I'm using Azure CDN on Azure Blob Storage where I put all the images in, in order to make it faster for visiting in China. The problem is, lots of my friends reported wrong images were displaying in my website and I asked one of my friends to check if the URLs were correct. Turned out, URL was the same but the image it pointed to was completely different. How's that possible? And how to solve things like this?
Edit: Also, I use the self-increment SQL ID as the file name so I can assure new file or the updated file won't use the same name as those deleted or modified files.
Correct Pointing on My Browser
Wrong Pointing on My Friend's Browser
As you can see on the devtool of Chrome, the src are the same but the photos displayed are different.

Maybe you need to purge files.
CDN is replicating your files to local servers, when you update files in storage it does not automatically update all servers. Purging is doing the job.
This is what can be reason, if not this then it sounds very weird for me.

Related

Css files not updating like other files

i am currently hosting my site on justhost (just as a test server), when i save my work on my local computer through aptana the files are automatically uploaded to the hosting server, and they appear fine. However this only works for my actual files like .php and .html
They do not work for my .css files, so if i save them and upload them the changes do not take effect, until like the next day, or if i turn my computer on and off and leave it a couple of hours, i am not sure why they are not taking effect immediately like the rest of the fiels.
I have tried deleting my cache and adding ?ver=1.0 to the end of the file name, but still no luck.
Also, i checked the hosting directly and the css file has updated to the correct version, but just does not show in browser.
Any ideas on what could be wrong, it would make life much easier if i could get them updating like the other files.
Thanks
I can't be sure what is causing this, but if I'm correct - the files do upload, its not a case of not uploading. It's one of these things
The Cache is holding it (already cleared it though?)
The file is doing some odd cross server transfer, depends what sort of hosting your on, but it may be the file is getting held up somewhere
Try clearing the DNS Cache
Start > type CMD > in the dialog type:
ipconfig /flushdns
That may force the computer to reload the file.
As for an ongoing solution to prevent it in the future I'm out...
I know it has been a while, but as others may find this question the way I did, the solution for me was to enable Cloudflare Developer Mode. Cloudflare was keeping the css files in cache and it drove me crazy to find the solution in another forum. I hope your case may be the same as mine as thus you can solve it as well.

Links continue to point to live server - Drupal Live to localhost

I have inherited a Drupal 6 site to maintain.
I am new to Drupal so there is an element of learning as I go.
I have encountered a strange issue after attempting to set up a test site on my local machine.
All my links on my local site continue to point to the live server. So all menus, login buttons, etc. all point towards the live site.
Steps I have taken:
checked settings.php to ensure that $base_url is set to "http://localhost:456"
checked settings.php to ensure that MySQL settings are correct
Taken an SQL dump of the entire local database and searched for any references to live site URL
deleted all the local cache data from database
Checked various blocks to ensure that there was no hard coding of links
Disabled language support as that does use separate URLS for each language
I am at a total loss as to where to go from here.
I can navigate through the site locally by replacing the URL in the address bar to point to the local site, and I have even managed to change the local theme so I can see which version of the site I'm on. The fact that I could do this means that the database is set up correctly.
Totally stumped as to where to go from here. Any takers?
The problem was that in the 'variable' table there was an entry with the URL for default language pointing to live site. There is a 'language' table which holds the URLS for each language e.g. eng.example.com for english and ru.example.com for russian. I had changed the urls here to point to local server, but it seems there is also an entry in the variable table which needed to be changed.
In case anybody runs into this problem and wants to change it, you need to change the metadata for the entry as well where S22 represents a string of 22 characters, you need to change it to the length of the string that you are entering, youll see what I mean when you look in the table!
Also, you need to clear your cache after making any change.
In your local server, go to your site directory->site->default and open your settings.php file
look for the base url and comment out that line it should be around line 144
The only thing left is you need to a search for the live site url in your complete code base. See if any module is changing the base url using the code. Though I am not sure how it can be done using code.
However instead of replacing the url you can edit the hosts file and add an entry like
127.0.0.1 livesite.com
If you are using Linux the location of the file is /etc/hosts
I had this problem. I moved the entire site from the remote to the local server to work on, but whenever I loaded the site it went to the live site. I believe the problem was the .htpaccess file. I updated all the core Drupal files, but as the .htpaccess file was hidden I didn't notice it was still there.
Note that even after I removed it, it wasn't until I opened a different site on the local server and then went back that the path worked correctly.

Orchard CMS- Configure Base URL

I installed the latest version of Orchard on my dev machine using a base url of localhost/frankgiotto. Then I moved the site to www.frankgiotto.com and updated my Base URL in the settings.
Site works perfectly. I love everything about it but the one thing is that all the links on every page are mapping to www.frankgiotto.com/frankgiotto/etc and I want simply www.frankgiotto.com/etc
This is driving me insane at the moment.. help anyone!?
p.s.. Yes, I made absolutely sure that Base Url is set to www.frankgiotto.com
Interestingly enough, www.frankgiotto.com/Blog and www.frankgiotto.com/frankgiotto/Blog both work and take me to the same place. Its the same with everything else on the site.
This is little out of context, but to make the orchard urls work without any issue on local just do the following
go to Web project
open property->Web
check for "virtual path", set it empty, and all will be fine
that will make the app run without "/", hence less chance for the above issue
Yes, that is a known issue unfortunately. This is because for now links and image addresses are just stored as plain HTML in the database. Ideally, they would be stored as logical references instead and could be rebased on the production server. This feature does not exist today so what we encourage people to do is to use a port rather than a virtual directory on their dev box if they are going to deploy at the root of a domain. This way relative urls just work. In your case I'm afraid you'll have to manually rebase the existing links and change your dev box configuration.

URL Routing and Relative Links Behavior

I'm building a website that stores a number of articles. The URL for each articles implements URL routing in the form /Articles/{categoryid}/{articleslug}.
Some articles have links to a graphics file. The link does not specify the full path so I'm storing the graphics file at /Articles/{categoryid}/{articleslug}/graphic.jpg.
This works fine on my desktop. But when I deployed the site to a shared hosting account, the behavior is different.
Now, the link only works if I store the graphics file at /Articles/{categoryid}/graphic.jpg. In other words, on my desktop, the {articleslug} is assumed to be a directory, but on the web it is assumed to be the name of the current page.
Does anyone know why the behavior changes? You can seen an example at http://www.blackbeltcoder.com/Articles/asp/creating-website-thumbnails-in-asp-net. Both the screenshot and download link near the top are broken links.
Without knowing more, it seems like the most likely cause would be a different version or configuration of IIS. The behavior of the web host makes all kinds of sense; the behavior of your desktop is confusing to me. Is your desktop doing a redirect from /Articles/{categoryid}/{articleslug} to /Articles/{categoryid}/{articleslug}/? Can you use Fiddler etc to see if the browser formats the GET request differently?
Thanks for the input. There probably wasn't enough information here for anyone to resolve this unless they've specifically seen the issue already.
At any rate, I was able to resolve it myself and I describe the resolution in a related question I posted at Relative Links with Extension-less URLs.
Thanks.

How would you allow users to edit attachments in a web application?

We have created a web application, using ASP.NET, that allows users to upload documents and attach them to business entities, like customers, contacts and so on.
The application runs on the intranet and all files are uploaded through the web application into a shared folder on the server.
I would like, right from the web page, for the user to open the actual file, edit it and then save the changes back to the original location. This is a piece of cake in a Windows environment, I'm just wondering what, if any, is the best way to handle this in a web environment?
The files are usually Word documents, Excel documents and images.
Clarification
We would display all the attachments in a list format. We would like it so that the user would click on an edit link and the file would be opened in the appropriate application, for example, Microsoft Word or Microsoft Excel. I think the file associations in Windows would already handle this. We are just trying to save our user the time to download the original file, make their changes, delete the old file, and the upload the new file.
SharePoint does this by exposing FrontPage extensions which Word and Excel know how to deal with.
If you want to look at a commercial product for ASP.NET that allows you to edit images with AJAX (no need for installed software), I work for a company that has one (Atalasoft)
WebDAV is probably what you want. (Free)
If all your client computers are Windows, map a shared folder on the server to the same drive letter on every client and use the file:// format.
Let's say you share \ServerName\ShareName to H: on every client's computer, the you can make the link as file://h:\pat_to_the_file_under_your_share\fileName.doc
If not every one of the client's computers are in Windows, then you might try to make your links as follows (not sure if ot works):
file://\ServerName\ShareName\pat_to_the_file_under_your_share\fileName.doc
I'm trying to do something with using file:// instead of http:// but it's real sporadic based on the browser. Seems to work fine in IE, okay in Firefox, and goes nowhere in Chrome.
Looks like I may just be stuck with downloading, editing, and re-uploading the document.
It sounds like you want something similar t eRoom, where the browser works in conjunction with a component that intercepts a stream from http, stores it in a temp folder, then fires up Word or Excel and allows you to edit the stream.
You may have to create a component that will intervene and create a temporary local copy of the file.
This tool should do what you need.
http://www.dlitools.com/dlitools/dlitoolsHome.nsf/0FA6B8B31F831F468525736B0001C606/4BBD7E8684EA8DB78525754E006C63A3?OpenDocument

Resources