Saving a file uploaded using POST
All posts by
.PhpSpreadsheet basics
Documentation https://phpspreadsheet.readthedocs.io/en/latest/ Using in your PHP file Add these to the top of your PHP file: Depending on your server you might need something like this instead: You can test it works using their example test code:
Installing PhpSpreadsheet
Server needs Composer installed (may well already have it). Log in via SSH Instructions here: https://github.com/PHPOffice/PhpSpreadsheetBut basically you just use this command: composer require phpoffice/phpspreadsheet That will do the install. PhpSpreaqdsheet will get added to the servers root “/vendor” folder, so in “/vendor/phpoffice/phpspreadsheet/”
.API’s general
HTTP API requests There four basic HTTP requests a client can make are: GET: To retrieve a resource.POST: To create a new resource.PUT: To edit or update an existing resource.DELETE: To delete a resource.
Uncaught ReferenceError: jQuery is not defined
Can happen when a non admin logged in user is on the site and nothing that requires jQuery is part of the page so your theme decides not to load it. If your custom code, e.g. some javascript on a page, needs it then you can use this to cause it to always be loaded […]
.Columns general
Display content in columns
Remote files
Copy a remote file to local server
Generate multipage PDF of text
This creates a text based pdf. Include in your header Export button Javascript code to do the export when the button is clicked
.jsPDF general
Documentation https://artskydj.github.io/jsPDF/docs/jsPDF.html
Generate Multipage PDF from Single Canvas of HTML
This is based on the example detailed here: https://www.freakyjolly.com/multipage-canvas-pdf-using-jspdf/ Its OK for some uses, but its an image-based output, so if your HTML is full of text, that text gets converted to an image grab before being added to the pdf and will get sliced for page joins anywhere, including in the middle of a […]