Nginx Server & Wordpress Weird JS loading - javascript

I'm uploading a JavaScript file that a freelancer that I hired sends me and when I access this file directly over the url, everything seems fine.
But now when I add one line of code to this file and upload it again, sometimes the changes are not displayed even when I access it again over the url or the line of code that I added is displayed but some lines of code are missing at the end.
I checked the file that I uploaded several times over different ftp clients and the file is exactly the file that I upload ofc.
The file is part of a Wordpress plugin, I'm running on a Nginx Server, I don't have any kind of caching plugin.
What is going on ?

Related

Build URL to data file download with link to folder

I have a web application that triggers actions at the server side which result in the generation of data files.
The so generated data files are stored within a folder at drive different from the one where the Web application is.
What I tried so far is to create a shortcut (Windows Server) next to the Index.html, where the shortcut points to the folder at the second drive.
This solution does not appear to work:
If I copy the data file to the same folder where the Index.html file is and enter navigate to the URL httm://127.0.0.1:324324/Data_File.xlsx I get the file downloaded.
If I enter httm://127.0.0.1:324324/MyShortcut/Data_File.xlsx (where MyShortcut points to a folder in drive D) the attempt fails.
How can I achieve this?
The need to access files in the different drive is essential.
You need to configure your server to serve that folder under different location. The only reason you are able to see your app and access that folder is cause server is set up to serve it ATM, not because you are making the right calls from the front or cause the front is asking nicely.
Don't know what Windows server version you are using and IIS version that goes on it, or are you even using IIS (you most probably do) but depending on what you use you need to do something in a lines of this:
IIS7 config
What you probably wanna do is create virtual folder in IIS. Try looking into it, then if you fail ask a question with proper tags according where are you stuck.
I don't see how this is connected to front-end at all so front end tags wont get you far.
EDIT:
Oh, in that case get a second file server running for that folder? This should be the fastest way, use what you can from this list: list

Sending a created website to somebody

I am just a beginner in HTML (and soon JS), and I was wondering, once my website is complete (an html file made in either Sublime or Notepad), how do I get that website to other people? If I wanted to make a website eventually with my online portfolio of videos and images, how would I get it out to people?
Uploading website files are one of the very first steps users have to take in order to publish their creation on the Internet. This tutorial will provide a generalized example on how to upload a website using one of three basic tools:
What you’ll need?
Before you begin this guide you’ll need the following:
Access to the control panel of your hosting account
Your website’s files (preferably compressed in a .zip or .tar.gz
format archive)
(Optional) An FTP client and FTP login details of your hosting
account
Option 1 – Upload Your Website via Hosting's File Manager
Navigate to your control panel’s Files category and open File
Manager
After that, go to the public_html directory, which is the root
directory of your domain (for example http://www.domainname.com/).
Your files should be uploaded there. The directory may also be changed depending on what URL you want it to be accessed from. In case
you want the content to show up on
http://www.domainname.com/something/ your content would need to be
located in public_html/something directory.
To start uploading, right-click with your mouse and select Upload
Files option.
To unzip your archive, right-click it and press Extract.
Once the content is located in your desired location, you will be able to access it using any browser.
Option 2 – Uploading Your Website via FTP
Some users prefer using an FTP client, such as FileZilla, SmartFTP, CoreFTP, or any other in order to upload their website. In this example, we will use Filezilla.
Firstly, you will need to get your FTP details.they
are located in your control panel’s FTP Access section. If you are not sure what your FTP password is, you can easily reset it by pressing Change account password section.
Open FileZilla and input your FTP connection details into the fields
at the top of the program, then click Quickconnect.
Once you are connected to the FTP server, use the file browser on
the LEFT side of the program to find your website’s files on your computer. After you have found your website’s files, use the file the browser on the RIGHT side to open your public_html directory on the hosting server. Once you have done this, you can simply drag-and-drop files from left to right and they will be uploaded to the server.(OPTIONAL) Similarly, you can upload a compressed archive via FTP by dragging-and-dropping from left to right. You will also need to extract it via File Manager. Refer to the “Option 1 — Uploading your website via File Manager” part of the tutorial above for instructions on how to extract archives via File Manager.
Option 3 – Uploading Your Website via cPanel’s File Manager
Click on the File Manager icon, located under the Files category.
Once inside the File Manager, open the public_html directory.
Click Upload after entering the public_html directory.
You can click “Select File” to select a singular file, or simply
drag-and-drop your file to the outlined area.
Once the upload is complete, return to the File Manager and you will
see the uploaded archive in your public_html directory. Right, click
the archive and select Extract to extract the archive.
If you receive a prompt asking to specify the location the archive
should be extracted to, make sure to specify /public_html.
The archive is now extracted, all files should now be located inside
public_html. Navigate back to public_html and see if the files were moved successfully.
Your website should now be fully uploaded and accessible via your
website’s URL. All that remains is to access your website and check if everything works correctly. Simply type in your domain name in
your browser, such as http://www.domainname.com/, and check if your
website works to your satisfaction
you have just learned how to upload a website. As you may see, you can upload a lot of files at once via an FTP program more easily, however, each file will be uploaded one-by-one. As a result, it may take a long time for each file to be uploaded separately, so it is still strongly advised to create a compressed archive of your files before uploading them.
On the other hand, the File manager is useful for uploading one or two files quickly, since you do not need a separate program for the File manager to work and can update your website on-the-fly, while working on other tasks inside your hosting control panel.

NG FILE UPLOAD and Sails JS

I'm uploading an image(s) for a certain item. I see the files are being stored and saved in the server just fine but yet it gives me a 404 error when the UI's supposed to show it, if I refresh in 2 seconds, it appears correctly.
I know this is weird and that I didn't give much information or code, it would be a mess if I paste all the functions and backend calls I'm doing, I just want to know if someone's has dealed with this kind of things or knows what it can be.
I
Ok, so the problem was that I was uploading the file(s) to the assets folder, and the view can't access to the files there, it searches for the ones in .tmp, so I uploaded them to .tmp and then copied them to assets, so in the next app lift, these files are copied to .tmp again, cause tmp is destroyed as soon as the server is stopped.

AJAX Request Won't Work on Internal Server

I'm using w3schools to try to understand how simple AJAX requests work and I came across this exercise page:
http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_load
I thought it was a simple example of an ajax request, so I copied and pasted the code into a plain ajax.htm file and copied and pasted the txt file it refers to:
http://www.w3schools.com/jquery/demo_test.txt
...and saved it as demo_test.txt file it refers to and saved them both in the same folder. (Keep in mind, I have an Apache server that processes PHP locally with no problem, so I would think a simple request like this would work on my local machine).
However when I click the button locally I get nothing. Then, when I upload the files to a different server (a "web host") suddenly it works.
So, this works on a webhost and it works at w3schools but it doesn't work locally on my machine in my root folder (where php works without a problem).
I would prefer to not have to upload my code before being able to test whether it works and would rather be able to process everything locally, like I do with PHP. Is it possible to do this locally or can I only make these requests remotely from my web host?
Why is my machine not processing this code? Any help would be appreciated. Thanks.
There are a lot of reasons you might not be able to load the file locally, but most will have to do with how you're serving the files. If you're using file:// you're going to run into problems; you said you have an Apache server, but didn't mention whether you were actually serving this site from it.
Have you checked to make sure that the route you're loading via your AJAX call is actually loading properly? E.g. if the ajax file is at your web root (http://local.site/ajax.html) and so is your txt file (http://local.site/demo_test.txt).
In this situation you can also always check your browser's Javascript console to see if you get any errors or if the files are actually loaded correctly. Depending on how you're serving and accessing the various files, you might be getting CORS errors as well.
The simplest solution is to make sure you're running on a local webserver (your Apache) instead of directly viewing files.

jQueryFileUpload upload a file given its URL

I'd like to use jQueryFileUpload to upload a file that is not on my computer but rather is at an external website so all I have is its URL, e.g., https://dl.dropboxusercontent.com/s/wkfr8d04dhgbd86/onarborLogo64.png.
I'm at a total loss on how to do this but I think it involves adding the file data programmatically rather than using the traditional <label for='myComputerFiles'>-based selection of files.
If this is correct, what next FileReader()?
Any thoughts would be appreciated.
You should do this on the server - it requires user intervention to download it locally, and that just seems hacky and unfriendly.
Reason? You would have to first download the file (which is an indeterminate process), and then upload it to the server. If you pass the URL to the server then it can perform the whole process in 1 action - a download (which is effectively the same as you uploading it). Also, the ability to read local files, which is what FileReader is for, does not mean you should download files to just upload them again. That's bad logic and your users will not appreciate it.
Also, Dropbox Chooser is not meant to be a way to download files. It's meant to be a replacement for downloading file, or uploading them to other servers... ...without having to worry about the complexities of implementing a file browser, authentication, or managing uploads and storage.
Since you're using S3, if there is an API call on S3 that allows you to specify a URL then that would be the most obvious thing to use. If you can't do that then you either need to download the file for the user (onto your server) and then upload the file to S3, or you're back to the original idea of downloading at the client and uploading from there. Either way, the introduction of S3 obviously adds another layer of complication, but I'd initially look at getting a URL from the client and getting that file on my server so I could do anything I wanted after that.
This previous question may be of some help in this area...
How to upload files directly to Amazon S3 from a remote server?

Categories