Setting up Trix Editor attachment uploading for Hostinger - javascript

I want to find out if and how I can get attachments uploaded through the Trix Editor to post to my personal website on Hostinger. I recently signed up for an account with Hostinger and uploaded the web app I'm developing in PHP. Everything is going fine so far, but now I want to upload attachments through Trix if at all possible.
I'm using the code at https://trix-editor.org/js/attachments.js verbatim, except I don't know what to put in for the HOST variable on line two.
I tried putting in my website URL here, not expecting it to work but hoping that the error messages might give me a clue. I tried to upload a .pdf, and I got a progress bar as it uploaded and everything, but no error messages, and of course nothing uploaded. I really don't know enough even to know what I should be looking for here.

Related

Question regarding uploading files to the internal website

I am encountering a problem on my internal website. Everything was working fine until someone turned the server off, so I had to turn on the server via Docker. The site was up and running fine after that.
However, my colleagues quickly realized that they could not add files to the website, i.e. you first upload files to the site, select save and then it will save the uploaded file. Upon further inspection, I found out that you could upload files from some pages only, i.e. both pages 1 and 2 allow you to upload documents, but only page 2 accepts the upload request and successfully uploads it to the site; page 1 will attempt to upload and return saved successfully, but the files will not have been uploaded.
To provide some context to the situation, I inputted "sudo pkill -f uwsgi -9" before running the server again using Docker. More importantly, the internal website is vital for everyday operations and cannot be down under any circumstances, so I am a bit reluctant to mess with the server in fear of destroying whatever that can still be used. My colleagues are still getting by because they can upload from another page and still have access to the information on the website.
Besides that, the biggest problem is that I have only been in this job for 2 weeks and do not know the code base through and through. The handover process was also bad because the previous guy left 2 weeks prior to me starting this job. I have contacted him and shown him the problem. He told me that he was also unfamiliar with this problem and that the system was running fine the whole time.
The error is as follows:
[error when I try to upload from this page]
[1]: https://i.stack.imgur.com/LnGWs.png [1]
Works fine here:
[works from this page]
[2]: https://i.stack.imgur.com/5QhdT.png [2]
The problem is that I am on a wild goose chase and cannot identify the problem. Moreover, the error suggests that the code base has some error, which conflicts with what the previous guy told me, as I have also seen the system up and running for the past 2 weeks.
Would be very grateful for any ideas!

What is wrong with my PDF after managing to put them to .ZIP and download successfully

I successfully downloaded .zip file which contains downloaded pdfs. My problem is when i extract it and open it, pdfs have some weird letters. It's my first time doing such thing so i'm somehow stuck and i don't know what might cause this problem. I get status 200 in postman and message "written" in terminal from console.log. Here's a screenshot of my code, and pdf also. If anyone knows, please help, i've been trying for a few days :/
code
pdf
pdf properties 1
pdf properties 2
Those pdf files may be referencing fonts that are not available on the viewing device. Try downloading them individually and see if you get the same results.
Update - The fonts all check out. Nothing exotic.
The only server side / transport issue that comes to mind is accessing a binary file in text mode but the correct content-type should preclude anything like that.
PDFs are already compressed, zip files only add value for batch download.
The symptom that the pdf properties are corrupted points to a pdf writer rendering bug. Some ways to confirm that hypothesis are to:
Lint the pdf file to ensure it is whole.
Try viewing it in a multitude of readers.
Submit to VirusTotal for malware evaluation.

How can I get around this "mixed content blocked" error with Blogger?

I am trying to add a Javascript picture gallery created with Wowslider to my Blogger blog.
I followed the instructions on the Wowslider website, and I thought I could serve the necessary files, including the images, from my server.
Unfortunately, after I set it all up, it didn't work, and by using Firebug, I discovered that the files on my server won't be shown on the Blogger server because my site uses http and Blogger uses https. So I was getting an "Blocked loading mixed active content" error.
As far as I can see, there's no way for me to load a directory of Javascript, CSS, HTML, and image files anywhere on the Blogger server.
Converting my website, which is hosted by a service out of my control, to use https is not an option.
Is there any way I can host my Wowslider picture gallery in such a way that Blogger will display it?
Turns out the problem is not as bad as I thought.
Blogger only serves pages in https mode when you're logged in and editing pages. When a visitor to the site is just viewing the blog, it's in http mode.
This means that if you embed a Wowslider into blogger, you won't be able to see it while you're editing it. However, you, and everybody else, will be able to see it after you publish it, log out, and view it as a visitor.
So in the end it works, it's just a little confusing because you won't be able to see the end result until after you publish.

HTML - file upload form does not work with iPad

Uploading files on the IPad is not possible because "Choose file" is grayed out. Is there a workaround to upload files in a iPad browser. I'm using the current chrome for iPad.
my upload code:
document.getElementById("files").addEventListener("change", function ( e ){...});
I don't think there is a workaround to upload files, it is simply not builded in the software... I've never seen a site were it was working. (only in apps)
https://discussions.apple.com/thread/3863546?start=0&tstart=0 is saying the same thing...
You can use the upload file dialog since iOS6, but it only provides access to photos. The best methods of getting a file upload working to your website are:
Create an app that can take file attachments from email and then push them to your website
Setup a special email address users can forward attachments to which then puts those into their account (this method is called piping)
This does however assume that the files needing to be uploaded are sitting in the user's mailbox.

CKEditor filemanager getting stuck uploading files?

I'm using CKEditor and it's inbuilt filemanager to allow people to change content/upload images to their site.
Everything works fine, except the file manager, if you upload an image it gets stuck loading claiming that it's "Transferring Data" and will continue to display this loader unless the page is refreshed.
The strange thing is that, on reloading the page you can see the file has been uploaded successfully.
Has anybody experienced this issue before? Does anybody have any idea what could be causing this behaviour?
Turned out there were a couple of outdated files that crept into the filemanager directory on the live site, not sure how or why, but that was what caused this issue.

Categories