title: XEP-0363: HTTP File Upload in Swift
body: <p>Working on chat application with XMPP ejabberd server, here i am not able to get slot for image upload, this is a document (<a href="http://xmpp.org/extensions/xep-0363.html" rel="nofollow noreferrer">http://xmpp.org/extensions/xep-0363.html</a>) for upload attachment on server</p>
  
  <p>Here it is my code, my problem is after requesting with this code no any response from server nothing happen my server is working i can able to send text message, please help.</p>
  
  <pre><code>        let iqRequest = DDXMLElement.element(withName: "iq") as! DDXMLElement
  
          iqRequest.addAttribute(withName: "from", stringValue: sender.myJID.full())
          iqRequest.addAttribute(withName: "id", stringValue: messageID!)
          iqRequest.addAttribute(withName: "type", stringValue: "get")
          iqRequest.addAttribute(withName: "to", stringValue: "upload.hostname")
  
           let requestElement = DDXMLElement.element(withName: "request", uri: "urn:xmpp:http:upload") as! DDXMLElement
  
           let fileNameElement = DDXMLElement.element(withName: "filename") as! DDXMLElement
           fileNameElement.stringValue = "imageName.png"
  
           let sizeElement = DDXMLElement.element(withName: "size") as! DDXMLElement
           sizeElement.stringValue = "23456"
  
           requestElement.addChild(fileNameElement)
           requestElement.addChild(sizeElement)
  
  
          iqRequest.addChild(requestElement)
          sender.send(iqRequest)
  </code></pre>