Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.28.5 (build 3282) - 23 February 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

New PHP Upload Process

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Mapantz
Posts: 1770
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: New PHP Upload Process

Post by Mapantz »

The upload.php file may have been updated. Did you transfer it across?
Image
User avatar
billy
Posts: 255
Joined: Mon 30 Nov 2015 10:54 am
Weather Station: WLL / Davis VP2+
Operating System: RPi bullseye
Location: Gooseberry Hill, Western Australia

Re: New PHP Upload Process

Post by billy »

No I didn't transfer but I see there hasn't been a change
broadstairs
Posts: 694
Joined: Thu 14 Aug 2008 7:17 am
Weather Station: Ecowitt GW1003/GW1103/GW2000
Operating System: Windows 7 and Linux
Location: Broadstairs, Kent, UK
Contact:

Re: New PHP Upload Process

Post by broadstairs »

Just a couple of thoughts from me. There is a default in the PHP upload process where the file being sent has to be in the directory where the upload.php exist or a sub-directory. If you want to upload a file which is not in that tree you have to set a flag in upload.php. Now this is just a guess but could this be an issue? Also could there be a typo in the remote path definition so you are trying to save a file in the wrong place?

I agree turning off permanently modsecurity is a bad idea.

Stuart
User avatar
billy
Posts: 255
Joined: Mon 30 Nov 2015 10:54 am
Weather Station: WLL / Davis VP2+
Operating System: RPi bullseye
Location: Gooseberry Hill, Western Australia

Re: New PHP Upload Process

Post by billy »

Thanks. The uploads go to a folder nested within the folder with upload.php, and I can’t see any typos. Both of these possibilities have been unchanged since b3241.
User avatar
mcrossley
Posts: 12492
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: New PHP Upload Process

Post by mcrossley »

I can look at adding a "content-type: text/plain" header for text files.

However, MX currently has no idea what the file content might be for binary files, but as binary files are sent as base-64 encoded text, it may be possible to use text/plain for them as well.
freddie
Posts: 2394
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: New PHP Upload Process

Post by freddie »

Or compress everything and use application/zip mime type?
Freddie
Image
User avatar
mcrossley
Posts: 12492
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: New PHP Upload Process

Post by mcrossley »

I suspect less sites would allow zip uploads than text though?
freddie
Posts: 2394
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: New PHP Upload Process

Post by freddie »

You're probably correct. I haven't actually looked at what is implemented in the MX code, but I should really as this is my "bread and butter" (but not in php).
Freddie
Image
User avatar
billy
Posts: 255
Joined: Mon 30 Nov 2015 10:54 am
Weather Station: WLL / Davis VP2+
Operating System: RPi bullseye
Location: Gooseberry Hill, Western Australia

Re: New PHP Upload Process

Post by billy »

Mark, I'm happy to be a guinea pig to test if that would help
mcrossley wrote: Mon 29 May 2023 4:52 pm I can look at adding a "content-type: text/plain" header for text files.

However, MX currently has no idea what the file content might be for binary files, but as binary files are sent as base-64 encoded text, it may be possible to use text/plain for them as well.
User avatar
mcrossley
Posts: 12492
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: New PHP Upload Process

Post by mcrossley »

OK, I'll bear that in mind - it may be a little while though as I'm off on a short break soon...
User avatar
billy
Posts: 255
Joined: Mon 30 Nov 2015 10:54 am
Weather Station: WLL / Davis VP2+
Operating System: RPi bullseye
Location: Gooseberry Hill, Western Australia

Re: New PHP Upload Process

Post by billy »

No worries … enjoy your time off :D
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: New PHP Upload Process

Post by Vegit8 »

I am having trouble getting my moon image to update having changed to the php process. Everything else seems to work except for an oddity explained at 2. below.

1.
I have placed the upload.php file in the root of my site www.geoffwebber.co.uk/weather
The local (at my end) path has not changed C:\CumulusMX\web\moon.png
I thought I understood the rule regarding pathing of files below the location of upload.php.
I have set the remote path for the image to /images/moon.png in the Moon Image section of /internetsettings.html

MX Diags says..
2023-07-01 15:12:00.680 PHP[Int]: Uploading Moon image file
2023-07-01 15:12:00.696 PHP[Int]: Uploading to /images/moon.png
2023-07-01 15:12:00.742 PHP[Int]: Upload to /images/moon.png: Response code = 500: InternalServerError
2023-07-01 15:12:00.742 PHP[Int]: Upload to /images/moon.png: Response text follows:
Error: Cannot create the target file /images/moon.png with this user
I'm guessing this is a permissions issue at the remote end, I don't know why, all the other uploads work fine and the above does not.

Example
2023-07-01 15:12:00.633 PHP[Int]: EOD Graph files upload starting
2023-07-01 15:12:00.633 PHP[Int]: Uploading graph data file: airquality.json
2023-07-01 15:12:00.633 PHP[Int]: Uploading to airquality.json
2023-07-01 15:12:00.680 PHP[Int]: Upload to airquality.json: Response code = 200: OK
2023-07-01 15:12:00.680 PHP[Int]: Upload to airquality.json: Response text follows:
Opening text file airquality.json for appending
Appending text file airquality.json
Writing text file airquality.json
Write complete
2.
I also get a strange situation from time to time where the Gauges page http://geoffwebber.co.uk/weather/gauges.htm goes into offline mode (red LED) AND the data displayed is many days out of date. Recently the ticker at the top said data not received for a number of days.
Yet checking the date/time of realtimegauges.txt and realtime.txt reveals these are both as up to date as one might expect.

Clicking on the LED icon restarts the page and all is good again.
Not a major issue, just odd to explain...

Cheers
SamiS
Posts: 349
Joined: Sun 27 Feb 2011 5:13 pm
Weather Station: Ecowitt HP2551 & GW1100
Operating System: Raspberry Pi OS
Location: Kangasala, Finland

Re: New PHP Upload Process

Post by SamiS »

Vegit8 wrote: Sun 02 Jul 2023 8:26 am I have placed the upload.php file in the root of my site www.geoffwebber.co.uk/weather
The local (at my end) path has not changed C:\CumulusMX\web\moon.png
I thought I understood the rule regarding pathing of files below the location of upload.php.
I have set the remote path for the image to /images/moon.png in the Moon Image section of /internetsettings.html

MX Diags says..
Error: Cannot create the target file /images/moon.png with this user
It seems you are trying to upload your moon image to the root of the webserver instead of subdirectory on your webfolder. If you want to have the image uploaded to weather/images/moon.png, remove the first slash prom the remote path (/images/moon.png is replaced with images/moon.png).
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: New PHP Upload Process

Post by Vegit8 »

It seems you are trying to upload your moon image to the root of the webserver instead of subdirectory on your webfolder. If you want to have the image uploaded to weather/images/moon.png, remove the first slash prom the remote path (/images/moon.png is replaced with images/moon.png).
Hah...
Thank you
Vegit8
Posts: 127
Joined: Fri 27 Sep 2013 2:11 pm
Weather Station: Davis Vantage Pro2
Operating System: Win 10
Location: Dorset
Contact:

Re: New PHP Upload Process

Post by Vegit8 »

any ideas folks?
2.
I also get a strange situation from time to time where the Gauges page http://geoffwebber.co.uk/weather/gauges.htm goes into offline mode (red LED) AND the data displayed is many days out of date. Recently the ticker at the top said data not received for a number of days.
Yet checking the date/time of realtimegauges.txt and realtime.txt reveals these are both as up to date as one might expect.

Clicking on the LED icon restarts the page and all is good again.
NOTE: This happens even when opening the page for the first time of the day (not every day however).

Not a major issue, just odd to explain...
Image
You do not have the required permissions to view the files attached to this post.
Post Reply