This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Possibility to save image on LM
#13
Hello,

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 nilSad

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 reasonSmile
Done is better than perfect
Reply


Messages In This Thread
RE: Possibility to save image on LM - by buuuudzik - 30.05.2018, 10:53

Forum Jump: