Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
david.felix #1
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Subject: file sharing not working with matrix sdk
Hi i am trying to send a file to a chat partner, but i am getting the error" object reference not set to an instance"

  1. Private WithEvents fm As New FileTransferManager
  2.     Private sid As String = ""
  3. dim fileinfo as system.io.fileinfo
  4. dim filename as string=""
  5. If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  6.             filename = (OpenFileDialog1.FileName)
  7.  fi = New IO.FileInfo(OpenFileDialog1.FileName)
  8.             'Dim getfileinfo As String = fi.Length
  9.         End If
  10.   sid = fm.Send(New Matrix.Jid("user@server.com"), filename, "description")
that is my code so far. I know i am missing something.

Thanks
This post was edited on 2015-08-16, 14:49 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
please look at the MiniClient code here:
https://gitlab.com/matrix-xmpp/samples/tree/master/csharp/…
https://gitlab.com/matrix-xmpp/samples/tree/master/vb/Mini…

this example includes file transfer.
Avatar
david.felix #3
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
I have seen the code, its the same with what i have. But please i am sending the file on the same form not on different form, your code is sending the file from different form.

I am doing it on the same form. I click on the send file button and it opens a dialog where i get the file and i have a textbox that holds the name of the file.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: