As per here:
Can't upload file attachments to phpBB3 forum on IIS
I'm having a problem with the plupload implementation in phpBB3.
I find that I get through
phpbb.plupload.uploader.bind('FilesAdded', function(up, files)
but never get to
phpbb.plupload.uploader.bind('FileUploaded', function(up, file, response)
unless my file is very small (< 5 KB). Is this simply down to reponses from the server (or lack thereof)? Any tips on figuring out the actual problem? So I can stop trying out a bunch of random crap?
EDIT:
Fiddler shows that the upload simply doesn't get any response from my server. Using the un-minified plupload files I can see that (I think) everything for the XMLHttpRequest is properly constructed. I essentially get through uploadChunk to xhr.send, but never get to xhr.onload.
How do I debug the server side problem?
It turns out this was a problem with a generic reverse proxy rule on our firewall. Adding a rule to specifically transfer HTTP(s) traffic directly to our webserver (rather than through the reverse proxy table) fixed things.
Related
files are created and deleted dynamicaly and names change over time due to css and js CMS plugin minifycation process, how can I do all js and css on a directory be pushed by Nginx?
I try do
index index.php;
http2_push 'path/to/files' *min.css; #not working
http2_push 'path/to/files' *min.js; #not working
http2_push 'path/to/file' favicon.ico; #works fine
forgive me language Im not english native
thanks for your time
Update: After looking for boredom a solution, I decided to go the long way, I modified the base plugin to create a custom one that creates files with defined name every time instead of one with a dynamic name, I have removed all text strings which denote information by removing $ ctime and $ hash from the generation of the static file.
index index.php;
http2_push 'path/to/files' static-name.min.css; #working
http2_push 'path/to/files' static-name.min.js; #working
http2_push 'path/to/file/' *.min.js; # still dont works but it does not matter anymore thanks for the answers.
Get PHP to do it for you.
First of all set up the following config in Nginx:
http2_push_preload on
Then get PHP to send preload link HTTP headers in the response to index.php:
header('Link: </styles/file.css>;rel=preload;as=style>');
Nginx will then use the preload HTTP headers as instructions to send HTTP/2 push requests.
This assumes your PHP code either knows the files you want to push or can find out.
Using preload hints also means that HTTP/1.1 requests will also get preload hints which will tell the browser to request these ASAP even before parsing the returned HTML.
The main downsides with this options are that you 1) can’t do this for static resources (e.g. if using index.html instead of index.php) and also 2) that it won’t start pushing until the index.php response is ready. For the latter HTTP Status 103 Early Hints allows a quick response but can’t find anything to suggest that Nginx supports this relatively new HTTP Header yet.
I have a webpage, which displays plots/info using .csv files. New files are added over time, and some go away. I need the webpage to change dynamically according to which files exist.
$.get('dir/'+myvar[1]+'.csv').done(function() {$('#Option1').show()});
$.get('dir/'+myvar[2]+'.csv').done(function() {$('#Option2').show()});
Then once the option is clicked on/selected, the $.get request is fired again and the file is actually used.
The issue is, there are a LOT options, hence alot of these requests over time. Each one throws a 404 error if the option wasn't available, and eventually I think it's slowing the webpage response down.
I was thinking of creating a .js file, which would effectively be a list of all viable options/files. The process creating the files can build the .js file each time a file is added/removed. Load the .js file on $(document).ready avoiding needless $.get requests and 404's.
The big question is, is this a viable/best practice solution, and is there an obviously better way to achieve this than I know? I am genuinely sorry if this question is too vague. Thanks.
Receiving a 404 for an ajax request should not slow down the webpage.
However, building a file that lists the available CSVs makes a lot of sense. I would consider using a JSON file (.json) instead of a Javascript file (.js).
Depending on your webserver, this functionality might be build in. For NGINX it is: http://nginx.org/en/docs/http/ngx_http_autoindex_module.html.
I am stuck at a problem I can't seem to figure out a "right" way.
I am uploading files directly to S3 from client side (using Plupload and sprightlysoft class). The server sets the policy document and all; however when uploading large files the session seems to expire and access to bucket would be denied (or at least that's what I think the problem is); the weird thing is that the uploader shows successful upload whilst javascript debugging shows 403 access denied. Any thought or idea on what could be done here? Is there a way to expand the session lifetime while the uploader is still uploading? or maybe another suitable approach?
Well, in case of use Ruby on Rails and carrierwave_direct, a mistake in this lines cause my problem:
def move_to_cache
true
end
def move_to_store
true
end
I returned false in move_to_cache, and didn't have move_to_store
This lines are usefull when uploading large files
again. I'm making a PL/SQL generated HTML5 web page. It's running a Oracle 10g XE server. Okay, now when the setup is clear, my problem - I need to include a Java Script file in the page. Simply
HTP.P('<script type="text/javascript" src="js/ScriptFileName.js"></script>');
Doesn't work of course. So i created a folder object and granted read,write to PUBLIC. Then changed the string to match the newly created object, instead of path. Still doesn't work. I know, i can write
HTP.P(<script type="text/javascript"> MY JAVA SCRIPT HERE</script>);
And i've done so with other scripts(Even had to write CSS this way). But this time this will not work. Reason being - the JavaScript i'm trying to run was normalized(or rather unnormalized), so it's written all in one line. And there is a lot of it too. I tried to reverse it to normal, but faild many a time.
So, I went online and searched for a solution. Found one. It seem's that this include should go not to the page, but to server config. Makes sense, since PL/SQL is server sided. But when i went looking for the usual httpd.conf, it's nowhere to be found in Database directory.So i went online again, result - NOT A WORD OF WHERE THE HELL ARE HTTP SERVER CONFIGS IN 10gXE IN ANY ORACLE MANUALS. Searched some forums - exactly 1 person asked where httpd.conf in XE is, and didn't get an answer. Please, help. I'm desperate.
P.S. I don't use APEX. I don't get that mumbo-jumbo. So i write in Notepad and run the scripts in SQL line.
Firstly, XE has its own built in HTTP server called the 'Embedded PL/SQL Gateway' or EPG. But you don't HAVE to use that. You can use an Oracle HTTP Server with the mod_plsql plugin. Or you can use the Apex listener.
The question is on what server is "ScriptFileName.js" ?
Is it a flat file on the database server ? If so, you'll need to use the Oracle HTTP Server (or Apache or similar) to serve it. The database is pretty much unaware of files on its server and the EPG can't deliver them. [At least not in any practical sense, you could do weird things with chicken entrails and UTL_FILE, but you don't want to go there.]
Is it a file stored in the database ? That sounds exotic, but it is pretty much how all the CSS, images etc are served up through the EPG. The best explanation on how to get files in and out of there is by Dietmar
Is it a file stored on a separate machine ? Often the best answer. The "src=" directive will be read by the end users browser. That will do an HTTP get to the URL. It doesn't have to be a URL on the same domain/host as the rest of the page.
So i'm very new to xml to javascript so i thought I would learn from w3schools, but this site
http://www.w3schools.com/xml/xml_to_html.asp shows an example that I can't mimic locally. I copy/pasted the .js and downloaded the xml but I just get a blank screen!
It's working in there try it yourself but not for me? Do I need it on a server or something?
Yes, that code retrieves the XML data from a web server using AJAX. Since you don't have a server running locally, you can change the URL to point directly to the w3school's version:
xmlhttp.open("GET","http://www.w3schools.com/xml/cd_catalog.xml",false);
Alternatively, play around on their online version ;)
well i guess you have to add the example xml (cd_catalog.xml) to your file system. and you definitively have to access the html file on a server (apache i.e.)
First, ensure that both HTML file (with the Javascript block in it) and XML file are placed in the same directory.
Next, you probably need to place those files under your local web-server and open the HTML like this:
http://[local server host]/ajax.html
instead of opening the file directly from e.g. Windows Explorer:
C:\[path to the file]\ajax.html
For the latter case you'll get an "Access is denied" error.
-- Pavel
Are you running this under a web server or just creating a couple of text files and loading them in your browser?
The "GET" request this relies upon could possibly be failing.
Use Apache or another similar HTTP server and run the example as if it were hosted on the web.