Use of send sync to transfer zip files

Hi All

I have a file on the server “test.zip” which I want to download to a client folder.

on the server I have in handleURL

  Var f As folderitem
  f=SpecialFolder.ApplicationData.child("test.zip")
  response.Status = 200
  response.MIMEType = "application/zip"
  response.file =f

on the client I have

Var outputFile As FolderItem = SpecialFolder.ApplicationData.child("MainFolder").child("subfolder"),child("test.zip")
socket.Sendsync("get","http://127.0.0.1:8080/GetData", outputfile)

FolderItem=SpecialFolder.ApplicationData.child("MainFolder").child("subfolder").child("test.zip")
outputFile.Unzip

this is as per the documentation…
URLConnection — Xojo documentation

when run I get the error nilobjectexception on the line

SpecialFolder.ApplicationData.child("MainFolder").child("subfolder"),child("test.zip")

if I remove the last child element it compiles to the next line

socket.Sendsync("get","http://127.0.0.1:8080/GetData", outputfile)

but again with nilobjectexception

Any help in clarifying what the issue is will be appreciated

if “MainFolder” or “subfolder” do not exist then you will cause a nilobjectexception, as you can’t use the Child method on a non-existent folder.

Also,

SpecialFolder.ApplicationData.child("MainFolder").child("subfolder"),child("test.zip")

//should be:

SpecialFolder.ApplicationData.child("MainFolder").child("subfolder").child("test.zip")

Hi Ian

Thanks for the response, I checked the path names ten time over and then found I was seeing what I expected to see not what was there!!! I’d transposed two characters.

Bottom line, it now works thanks to making me focus on the right bit

Grant

So easy to do…