Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • U utils
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • f-interop-contributors
  • utils
  • Issues
  • #3

Closed
Open
Created Jul 05, 2018 by Chika Ngwu@cngwuContributor

How are we supposed to use MsgUiSendFileToDownload?

Hey there!
I tried using the new Messagetype MsgUiSendFileToDownload to push a file from the container to the GUI.
I'v used following approaches to get it working, but unfortunately it's not working:

Commit1:

self.send_message(MsgUiSendFileToDownload(fields=[{"name": "results.zip", "type": "data", "value": None}]))

Result:
just a broken file (qwq)

Commit2:

self.send_message(MsgUiSendFileToDownload(fields=[{"name": "resulewfewfts.zip", "type": "data", "value": None}]))

Result:
just a broken file v2 (but atleast I know that the file is "touch(ed)" and then "sent?" to the GUI)
(will omit "just a broken file")

Commit3:

self.send_message(MsgUiSendFileToDownload(fields=[{"name": "/root/test/results.zip", "type": "data", "value": None}]))

Result:
nothing - abs path won't change the outcome...

Commit4:

self.send_message(MsgUiSendFileToDownload(fields=[{"name": "results.zip", "type": "data", "value": "results.zip"}]))

Result: value + rel path = None

Commit5:

with zipfile.ZipFile("results.zip", "r") as resultzip:
    self.send_message(MsgUiSendFileToDownload(fields=[{"name": "results.zip", "type": "data", "value": resultzip}]))

Result:
value + filepointer = None

Commit6:

with zipfile.ZipFile("results.zip", "r") as resultzip:
    self.send_message(MsgUiSendFileToDownload(fields=[{"name": "results.zip", "type": "data", "value": resultzip.read()}]))

Result:
value + fp.read() = None

The Question is:
Could you maybe provide a snippet that'll show how to use this new message?

Edited Jul 05, 2018 by Chika Ngwu
Assignee
Assign to
Time tracking