Community discussions

MikroTik App
 
jamecollins
just joined
Topic Author
Posts: 18
Joined: Tue Apr 11, 2017 1:00 pm

Upload file with fetch on mode http

Wed Apr 12, 2017 4:45 am

I have try upload file with fetch on mode ftp, that okay. But how can I upload file with http mode? Thanks for your support.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26322
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Upload file with fetch on mode http

Wed Apr 12, 2017 12:42 pm

How would that work exactly?
 
jamecollins
just joined
Topic Author
Posts: 18
Joined: Tue Apr 11, 2017 1:00 pm

Re: Upload file with fetch on mode http

Thu Apr 13, 2017 4:24 am

How would that work exactly?
Thanks for your reply. I want upload file to my server via http, not by ftp protocol. And one more question about checking result of upload file. I follow this method but this not work. viewtopic.php?t=114626
Thanks
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26322
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Upload file with fetch on mode http

Thu Apr 13, 2017 9:51 am

how does the server support this? are you talking about an upload FORM element, or some HTTP POST request or what? You can't just upload files to any server. There has to be some specific method the server is expecting, and you must know which one.
 
jamecollins
just joined
Topic Author
Posts: 18
Joined: Tue Apr 11, 2017 1:00 pm

Re: Upload file with fetch on mode http

Fri Apr 14, 2017 4:19 am

how does the server support this? are you talking about an upload FORM element, or some HTTP POST request or what? You can't just upload files to any server. There has to be some specific method the server is expecting, and you must know which one.
Thanks for your reply. Yes I want upload file via HTTP POST request.
 
MSapogov
just joined
Posts: 3
Joined: Mon Nov 28, 2016 1:21 pm

Re: Upload file with fetch on mode http

Fri May 26, 2017 5:50 am

Hello!
RouteOS 6.39.1
I need upload XML file to my Hikvision ip camera from mikrotik.
/tool fetch url="http://admin:12345@192.168.11.51:80/Video/inputs/channels/1/overlays/text" http-method=post http-data="new.xml"
mikrotic responce:
[admin@Bee-GW] > /tool fetch url="http://admin:12345@192.168.11.51:80/Video/inputs/channels/1/overlays/text" http-method=post http-data="new.xml"     
  status: failed

failure: closing connection: <400 Bad Request> 192.168.11.51:80 (4)
new.xml :
<?xml version="1.0" encoding="UTF-8"?>
<TextOverlayList version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<TextOverlay>
<id>1</id>
<enabled>true</enabled>
<posX>16</posX>
<posY>32</posY>
<message>Test !</message>
</TextOverlay>
</TextOverlayList>
From linux machine - is OK
curl -T new.xml http://admin:12345@192.168.11.51:80/Video/inputs/channels/1/overlays/text
linux responce:
root@Bee-WWW:/home/script/ipcamera/temp# curl -T new.xml http://admin:12345@192.168.11.51/Video/inputs/channels/1/overlays/text

<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="1.0" xmlns="http://www.hikvision.com/ver10/XMLSchema">
<requestURL>/Video/inputs/channels/1/overlays/text</requestURL>
<statusCode>1</statusCode>
<statusString>OK</statusString>
</ResponseStatus>
 
eehan
just joined
Posts: 10
Joined: Fri Aug 18, 2006 2:45 am

Re: Upload file with fetch on mode http

Thu Aug 08, 2019 5:28 pm

Did you guys work this out? FYI, I have worked out how to control the Hikvision by the XML API from Mikrotik script - let me know if you are interested.
 
User avatar
NetVicious
Member Candidate
Member Candidate
Posts: 128
Joined: Fri Nov 13, 2009 3:30 pm
Location: Spain

Re: Upload file with fetch on mode http

Wed Sep 25, 2019 1:55 pm

http-data parameter of /tool fetch it's only used to set which string will be sent to the server when doing one upload.

It doesn't work (at this moment with RouterOS 6.45.6) in the way you're trying to do writing the name of the file you want to upload on the http-data parameter.

You should use the ftp mode of the fetch tool.
 
mstsc
just joined
Posts: 4
Joined: Fri Nov 16, 2018 12:13 am

Re: Upload file with fetch on mode http

Tue Dec 29, 2020 11:38 am

Did you guys work this out? FYI, I have worked out how to control the Hikvision by the XML API from Mikrotik script - let me know if you are interested.
Please tell us how you did it.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Upload file with fetch on mode http

Sat Feb 19, 2022 1:22 am

...
 
MechanicREX
just joined
Posts: 3
Joined: Tue Apr 19, 2022 8:46 am

Re: Upload file with fetch on mode http

Tue Apr 19, 2022 9:09 am

Good time of day to everyone!
ROS v.6.49.5
I have a similar problem, I can read a file using the Hikvision API,
 > /tool fetch keep-result=yes url="http://admin:password@192.168.0.155:80/ISAPI/Smart/FieldDetection" mode=http dst-path="DetectionON.xml"
but I can't write it using the Hikvision API manual.
FTP also does not work, there is information that Mikrotik does not support sending files via HTTP / HTTPS and suggests using FTP

Unfortunately at the moment fetch does not provide such option to send files over http/https, for this you have to use FTP.
Best regards,
Pauls J.

How to implement file upload? Help me with the correct spelling of the appeal to the API with sending the file to the Hikvision video camera.
curl -T works for everyone, but here it is unclear how to implement it.
You do not have the required permissions to view the files attached to this post.
 
MechanicREX
just joined
Posts: 3
Joined: Tue Apr 19, 2022 8:46 am

Re: Upload file with fetch on mode http

Thu Apr 21, 2022 9:46 am

del
Last edited by MechanicREX on Wed Apr 27, 2022 10:29 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Upload file with fetch on mode http

Thu Apr 21, 2022 4:25 pm

Ask Hikvision to be compatible with MikroTik products.
 
MechanicREX
just joined
Posts: 3
Joined: Tue Apr 19, 2022 8:46 am

Re: Upload file with fetch on mode http

Wed Apr 27, 2022 10:31 am

Ask Hikvision to be compatible with MikroTik products.
funny
I solved this issue without contacting Hikvision
And I found the solution on my own without any help at all
 
msatter
Forum Guru
Forum Guru
Posts: 2897
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Upload file with fetch on mode http

Wed Apr 27, 2022 10:46 am

Great, and do you feel any urge to share that solution? So others don't have to find that solution on their own? :)

Who is online

Users browsing this forum: Bing [Bot] and 19 guests