Jump to content

Get uploaded image file name


This topic is 4331 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am using SuperContainer to upload medical images to a server, which is working fine. But, occasionally we have need to rotate or otherwise edit the images. I understand the availability to download the image, edit, and then re-upload, but I have run into a few issues.

1. The location where these downloaded images are stored is far from convenient; is there a way to change this default download location to a folder on the desktop?

2. I would love to be able to calculate the FULL filepath to the image, not just the folder containing the image. Is there a way to set a field to only the name of the image? So for example, I have uploaded an image, store at /SuperContainer/Files/Photos/PatientName/Date/image1234.jpg Is there a way to set a field to just the "image1234.jpg" during the upload process?

If there is a better solution for basic image editing and manipulation, I would love some ideas.

Thanks

Kevin

Link to comment
Share on other sites

1. Files are downloaded to the location that you choose either in your download script (if you have one) or where you choose in the file chooser dialog. If you are specifying an inconvenient directory to download the files to right now in your SCDownload function I recommend changing that to a more convenient location, or allowing your users to choose where to download the files to using the SCChoose function. If you are right-clicking on the web viewer and selecting "Save File" and are selecting a direcotry that is inconvenient for you you may want to select a different directory, such as your desktop.

2. You can get the name of a file stored at a SuperContainer URL by using the SCGetInfo function, but you should never calculate a filename as part of your SuperContainer path.

Your SuperContainer path is the equivalent to the name of a regular container field. You would not want to name your container field "mypicture.jpg" and upload your mypicture.jpg file to it and make a new container field for every file and every record that you want to upload. You would just name your container "picture" and upload the "mypicture.jpg" file to it. Record 2 might have the file "otherpicture.jpg" uploaded to the "picture" container field. You would not want to make two container fields, one named "mypicture.jpg" in record one and a second container field named "otherpicture.jpg" for record two for storing the two images in two different records, or you would have to make a new container field in your table for every new record that you make. It would be almost impossible for you to write any scripting and you would contantly need to edit your table.

It would be the equivalent of making a field named "Bob" and a second field named "Joe" for your two contact records first names, Bob and Joe, when really all you need is a field named "First name" in which you store the text "Bob" and "Joe" on the two different records.

Link to comment
Share on other sites

Thanks for the quick reply.

I see, I can choose the location with SCDownload; one quick question, what is the filepath (of the file I am downloading) relative to? Can I simply use cResourceIdentifier, or cFilesURL, or some other path relative to /SuperContainer/Files ? I plan to always download TO the desktop, so no problem there.

The reason I want to be able to calculate the full path, including the file name, is to be able to do other tasks not using SuperContainer, and to not have to know the actual file name. We may want to run a shell script to rotate the image 90 degrees, but I need to be able to calculate in the image name to do this, not just the directory in which it lives. I have tried the SCGetInfo with no luck, but I believe I am not putting in an appropriate path. My question there is the same; which path to feed the function? The full, http:// path, or some other relative to the supercontainer directory?

Link to comment
Share on other sites

The path for both of your questions should be the part that comes after /SuperContainer/Files/.

If you URL is"

http://myserver.com/SuperContainer/Files/mydatabase/myrecordID

your 'path' would be:

/mydatabase/myrecordID

Again, you should not access the file by specifying the filename. If you want to get the full file stored at a location through a URL you can use the RawData URL instead of Files to access the file. If you try to specify the filename you will just get an empty SuperContainer URL one folder deeper, which happens to be named the same as the file you are trying to reach.

You should use:

http://myserver.com/SuperContainer/RawData/mydatabase/myrecordID

Link to comment
Share on other sites

Thanks so much, Smef. I think I got things figured out.

One of our last must-haves to a replacement for our current photo library solution is a way to burn a disc with all the patient images. Does supercontainer have a slick way of exporting or downloading (I guess recursively?) all files in a specific folder? My current path setup is:

Supercontainer/Files/Photo Libraries/patientName/eventName/serialNumber/image.jpg

I would need to get everything inside eventName, downloaded to the desktop to burn. Perhaps a shell script would be best, but maybe supercontainer can do this?

Link to comment
Share on other sites

Are you including your filename in your path? It should not be included in the path that you are using. If so, your path will end up being something like

Supercontainer/Files/Photo Libraries/patientName/eventName/serialNumber/image.jpg (with image.jpg stored at that location)

and then when you change the file your path will still be

Supercontainer/Files/Photo Libraries/patientName/eventName/serialNumber/image.jpg (with myotherimage.jpg stored at that location)

Again, you should NOT include the filename in your path. You risk breaking your links depending on your calculations. Your path should just be:

Supercontainer/Files/Photo Libraries/patientName/eventName/serialNumber/

You wouldn't name a regular field in your database after an individual file that you are uploading to a single record, and you shouldn't use the filename in your supercontainer path.

Please give me a call or contact me on skype if you have further questions about why or how you should not use the filename in your supercontainer path.

If you want to do a batch upload or download you can script it using the SuperContainer companion plugin, which will work very well for what you are trying to do.

Link to comment
Share on other sites

This topic is 4331 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.