While the MedImage App is a useful tool, it is certainly not all-comprehensive, and since the MedImage Server is an open platform we encourage other developers to send files from their own apps into the MedImage Server. This provides developers with a tried and tested route for their photos (or other files) to be sent to an increasingly wide range of back-end medical systems.
From your app you can call the pairing script
https://medimage-pair.atomjump.com/med-genid.php?compare=[user's 4 letter code from MedImage Server]
Which will return a MedImage Server URL on a successful code e.g.
Or on a failure:
This should then have a multi-part https POST request done with the image or file attached, to the domain part of the URL, with “/api/photo” appended:
The file name should have the hash at the end of the server URL entered at the beginning to create the correct ‘bucket’ or folder in order for it to download to your server i.e.
- The filename string entered into the POST request should have any spaces replaced with hyphens ‘-‘.
- A hash in front of any word from the original file-name string signifies a new folder on the server.
Note: .pdf files are not currently supported by the https://medimage-nz1.atomjump.com/ server, which is running ver 1.4, rather than ver >= 1.5. You will need to set up your own proxy server, to test any files other than a .jpg image file.
Checking if a file exits
To check if a file exists (useful to see if the file has been transferred from the proxy server to the final destination), use e.g.
where the file path in the check parameter should be URL encoded.
This will return either ‘true’ if it exists or ‘none’ if it doesn’t.
Testing using a browser
You can create a local .html file and open this in a local browser.
<html> <body> <form action="https://medimage-nz1.atomjump.com/api/photo" method="post" enctype="multipart/form-data"> <p><input type="file" name="file1"></p> <p><button type="submit">Submit</button></p> </form> </body> </html>
Where the action=”” is the domain part of the paired URL, with “/api/photo” appended. Rename your local file name with your own hash e.g.
and then try selecting and submitting the file within the browser. You should see a
Received upload successfully!
message, if the file has gone through, and after 10 seconds, you should see the file in your target folder. If you get no visual message, or some other message, the file has not been sent correctly.
Return HTTP codes include:
The MedImage App source code is available to browse at GitHub.