Can you show us an example of ActivityStarter.ResultUri?
Also for newName you not need the working directory
Try to create an example project to only upload an image, for example from the assets to find out where exactly is the error…
Alternatively use a working solution… here is my ftp extension App Inventor Extensions: FTP | Pura Vida Apps
See also
Taifun