I took two screenshots for better understanding:
The first one shows what the function getDataUploads returns, if a zip file has been uploaded,
the second one is the javascript function from the FMEServer.js file wich cycles through the 'files'-array searching for a property 'name'.
Zipfiles are all listed in the child node 'archive', so the for-each loop gets for the 'name' property undefined.
I stumbled over the fme server developers playground, there's an example how to upload files in a session.Â
http://playground.fmeserver.com/javascript/server-uploads/upload-file-in-session/
Even here the problem exists, the dropdown menu "Source Format" offers ESRI Shape, the answer from getDataUploads is similar to mine:
{
    "serviceResponse": {
        "statusInfo": {
            "status": "success"
        },
        "session": "54001B18670924F76B94CB5DF3B3DD80",
        "files": {
            "path": "",
            "folder": ,
                {
                    "name": ""
                }
            ],
            "archive": Â
                {
                    "size": 10038818,
                    "name": "Webanwendung_LHS_VS.zip"
                }
            ]
        }
    }
}
Trying to "Run Workspace With Data" says, that no file is uploaded if you try a zipped up Shape file. But since there is no posibility to select mulitple files there is no way to upload shape except as a zip.
Don't know if it will work but try to rename your zip file to .shz
There's a parameter, you can set for fileuploads, that forces zip files to be unzipped:
opt_extractarchive = true
This parameter can't be set in the FMEServer.js-method uploadData(), it hast to be sent with the HTTP POST or HTTP PUT request to fmedataupload service (in FMEServer.js). I think it's also possible to send this as a parameter in the getSession method.
I myself added following line to the FMEServer.js in the dataUpload method:
params.append('opt_extractarchive', true);
(In my case every uploaded zip shall be unzipped for processing).
Don't know if it will work but try to rename your zip file to .shz
@larry, thanks for your advice, but just yesterday i got the correct answer from the guys at conterra. See answer below.
Hi Marius,
Â
Â
I am trying to achieve the same result - to upload zipped shp and run some workspace.
Â
Using your suggestion doesn't give any positive result.
params.append('opt_extractarchive', true);
In the debugger i still get a message that i do not have any file:
Â
no element found       fileUpload.fmw:1:1
Could you please let me know if your suggestion works for you?
Â
Hey there, sorry for the late response!
For me the solution works, i inserted the parameter another way. I manipulated the original FMEServer.js file, there is a codeline setting the parameters for an ajax call and sending it.
getSession : function(repository, workspace, callback){
callback = callback || null;
        var url = buildURL('{{svr}}/fmedataupload/' + repository + '/' + workspace);
var params = 'opt_extractarchive=true&opt;_pathlevel=3&opt;_fullpath=true&
tm_priority=5&token;='Â +Â getConfig('token');
ajax(url, callback, 'POST', params, 'application/x-www-form-urlencoded');
I also configured my job priority there.