marfar:1. My users do an HTTP upload. One of the required parameters is "destFolderPath". Does this mean I can specify to upload to a particular filename? So, suppose the user selects to upload the file "myPhoto.jpg", but I specify &destFolderPath=".../blah/CustomFilename.jpg" as a parameter, then does Nirvanix automatically rename the file for me to "CustomFilename.jpg"? That's what I want, to avoid having to do a RenameFile call as well.
In the HTTP Protocol the header for a file upload includes the filename. We use that as the destination filename which we combine with the destFolderPath to get the final destination of the file. If you wanted to change the filename you would change the HTTP Header that defines the filename.
The section on HTTP Uploads in the document can be found at: http://developer.nirvanix.com/sitefiles/1000/API.html#_Toc175999901
The Custom HTTP Upload has the header format which has filename="myDestFilename.jpg" as seen below:
-----------------------------170062046428149\r\n
Content-Disposition: form-data; name="fileContent"; filename="myfile.dat"\r\n
Content-Type: binary/octet-stream\r\n
Content-Range: 0-4/5\r\n
\r\n
0xf0 0xf1 0xf2 0xf3 0xf4\r\n
-----------------------------170062046428149--\r\n
Alternately, you can have a callback handler that waits for our call telling you when the upload has finished. You can write code that will automatically rename the file when this call is made to your system.
marfar:2. My users do an HTTP upload, and I get a failed response via my callback URL. One of the parameters I get is "NVX.absolutePath": so does this mean that a failed upload is living on Nirvanix, and I then need to explicitly delete it?
Since the file is being reported as failed it will not be added to our system. Usually this will occur if there is a protocol violation or if there is an internet error while sending the file. Any time there is a failure we consider it a complete failure and will remove the data sent as part of that upload.
marfar:3. I send an audio transcode request via REST/SOAP, get a response indicating whether the request succeeded, and then wait for the callback to see whether the actual transcode worked. But, this is not documented in the docs -- only the upload callback is documented. I need to know what info I get in the transcode callback, other than success/failure?
For audio / video transcode calls the callback will contain
NVX.returnCode an integer representing the status of the upload. Did it
fail? Success? Return
code 0 means no error.
NVX.errorMessage a string describing the error message associated with any error being returned. This will only be returned if the returnCode is non-zero
marfar:4. If the transcode callback tells me that a transcode failed, does the failed file still live on Nirvanix such that I need to go and explicitly delete it? I assume that the original file is still on Nirvanix, until I explicitly delete it?
For a transcode you will have the source and destination files. If there is a failure the destination will not be created. The source will stay in the same state regardless of the operations performed against it. This is true for image manipulation, and audio / video transcode.
marfar:5. For audio transcoding, I specify a "destFilePath" parameter, but the doc examples are not fully clear on this -- since its a path, does that mean I can specify to create the transcoded file in a different directory than the source file? And if so, do I first need to create the directory, or will Nirvanix create it automatically for me? What if there are naming collisions (an identically named file in the destination directory already exists)?
Our parameters follow the format of | target | Item | so in the case of destFilePath it will be the destination file (usually the file being created), that its a file and that its the path. This means the parameter is a combination of destination folder and path. For any of the destination paths we will automatically create the tree for you. This reduces the number of calls you need to make to build a final destination such as /the/path/is/long/file.txt on an image resize destFilePath will generate the whole path if it doesn't exist and place the file under the /the/path/is/long directory.
Feel free to write if you have any additional questions.
Regards,
Barry R.