When you do a DeleteFile request on a RemoteThing that includes File Transfer functionality, it will be looking in the defined Remote File Repositories, you will need to look at the configuration of the Thingworx Edge MicroServer. Then you'll use the Alias, whatever path within the alias and the file name.
So let's say the remote repository is defined as MyRemoteRepo : "/path/"
You'd delete from MyRemoteRepo/whateversubfoldersdefined/filetodelete.fileextension
Thanks for your response Pai...
So, for the 'path' attribute of DeleteFile (the only attribute there is), I would need to pass in any subdirectory plus the actual filename within that subdirectory?
If so, that means somehow I need to be able to concatenate the subdirectory and the filename, doesn't it? From my call to ListFiles (if I want to let a user pick the file from a list), I get separate path and file fields back, but no full file path. So I'm not sure how to specify in the path attribute of DeleteFile that the single path attribute there should contain the concatenated string to provide both a subdirectory and the specific filename.
Sorry if I'm missing something.
I should probably add that our company has also bought a license for Thingworx but we haven't installed a system of our own yet. That's under the e-mail of our VP of sales, email@example.com I have gone through the ThingWorx EMS demo at http://www.thingworx.com/developer/device-kits/pc-ems and saw the web interface to control the device. The mashup however never seemed to connect to it. Both were running in Chrome on the same Windows 64-bit laptop, and I'd installed the PCEMS.exe file.
I'm a little unsure about whether I'm getting the right documentation to seriously get started... if I need to install the PTC ELEARNING LIBRARIES locally to access the real documentation for a newbie.
But to go back to this particular client I'm attempting to help... they have a startup script that I believe starts the WebSockets EMS on their linux edge unit. Note that I don't see a /MicroServer/ directory anywhere on that unit... so their system diverges from what I read in things like the ThingWorx WebSocket-Based Edge MicroServer User's Guide. I think that it is running the EMS though, because from a mashup I see whether the particular unit is connected. I can browser files on it from a mashup, I can choose a file and tell the unit to play it (if it's a video) on the unit.
And I can delete a file from a mashup but only if I manually concatenate the virtual path and the filename in the data panel in the lower right of ThingWorx Composer for DeleteFile's 'path' field.
I'm trying to get the three .java files the client created which will doubtless help, but am waiting on them. But the way their EMS stuff seems to be launched from a script called ems.sh on the unit boils down to this line that runs it as a Java application:
java -cp “$fileList” (classpath to the various ThingWorx jar files)
com.<customer>.RefreshClient (path to their ‘main’ class--I've just changed their company name here in this posting to <customer>)
/opt/Refresh (directory that maps to the local repository? ‘/incoming/‘ seems to map to /opt/Refresh/Videos/Shared/ which seems to be connected because I see the files in there from a mashup)
/opt/Refresh/Database/refresh_database.db (local db)
So, currently I'm looking at DeleteFile, which I will need, but my bigger goal is to get File Upload to the unit working. I can--from a mashup--choose a file on my laptop where I'm viewing a mashup in my Chrome browser and press the upload button. I see progress go up to 100% but then I always get an error. I also don't think the service on the edge unit is working because when I open the debug/trace window, I never see any indication that that file upload service has been called. I.e. I don't see Service Parameters showing values, and I don't see a green icon in the upper-right corner of that section of the debug window. For all the other services I call, I do see a green icon, and number of times the service has been invoked.
It seems like I'm probably only uploading the file to <customer>-sandbox.cloud.thingworx.com but that then the ThingWorx server cannot connect to the File Upload service on my edge device to really push it out. But I'm not sure if that's the correct interpretation of what I see.