Hello,
I am trying to use upload example in React app.
This is request payload from browser:
And this is .lp file which is reachable but instead of data it prints 3 times nil
This is the info from console:
Maybe somebody has some advice what is wrong?
I've found that firmware was from 2016 and this was the reason
I am trying to use upload example in React app.
This is request payload from browser:
Code:
------WebKitFormBoundarybICCNBVTBpxGOsWE
Content-Disposition: form-data; name="file"; filename="IMG_7393.PNG"
Content-Type: image/png
------WebKitFormBoundarybICCNBVTBpxGOsWE
Content-Disposition: form-data; name="file_filename"
livingRoom
------WebKitFormBoundarybICCNBVTBpxGOsWE
Content-Disposition: form-data; name="file_fileextension"
jpg
------WebKitFormBoundarybICCNBVTBpxGOsWE--
And this is .lp file which is reachable but instead of data it prints 3 times nil
Code:
<?
require('apps')
print(getvar('file'), getvar('file_filename'), getvar('name'))
upload()
filedata = getvar('file')
filename = getvar('file_filename')
if type(filedata) == 'string' and #filedata > 0 then
log(filename, #filedata)
end
?>
This is the info from console:
Code:
nilnilnil
Error: /lib/genohm-scada/web/lib.lua:0: attempt to call global 'setvar' (a nil value)
Maybe somebody has some advice what is wrong?
I've found that firmware was from 2016 and this was the reason
Done is better than perfect