What suggested by @AdityaKeyal is definitely doable, but it may require some change to your code. I would try to see if you can use a more convenient location to store the temporary image while sending it, and simply removing when the network process ends succesfully.
According to your "Program File folder" it seems you're on a Windows machine (even if you've backslashes in your paths). IMHO You should use the environment variable %TEMP% which points to different locations on different Windows versions, but is the defined location for this kind of temporary data.
If you are on Linux or OSX you can use /tmp to write temporary data. The folder is writable by everyone.