3a88c02326aadbb1df3436cd519f7b8a4df6ae5b
chmalee
  Thu Jun 6 15:32:15 2024 -0700
Work in progress using the mysql table for hubSpace on client side

diff --git src/hg/hgHubConnect/hooks/pre-create.c src/hg/hgHubConnect/hooks/pre-create.c
index 00be2ad..053afcd 100644
--- src/hg/hgHubConnect/hooks/pre-create.c
+++ src/hg/hgHubConnect/hooks/pre-create.c
@@ -64,39 +64,39 @@
         char *reqCookie= jsonQueryString(req, "", "Event.HTTPRequest.Header.Cookie[0]", NULL);
         if (reqCookie)
             {
             setenv("HTTP_COOKIE", reqCookie, 0);
             }
         fprintf(stderr, "reqCookie='%s'\n", reqCookie);
         char *userName = (loginSystemEnabled() || wikiLinkEnabled()) ? wikiLinkUserName() : NULL;
         fprintf(stderr, "userName='%s'\n'", userName);
         if (!userName)
             {
             errAbort("You are not logged in. Please navigate to My Data -> My Sessions and log in or create an account.");
             }
         else
             {
             long reqFileSize = jsonQueryInt(req, "", "Event.Upload.Size", 0, NULL);
-            char *reqFileName = jsonQueryString(req, "", "Event.Upload.MetaData.filename", NULL);
+            char *reqFileName = jsonQueryString(req, "", "Event.Upload.MetaData.fileName", NULL);
             long currQuota = checkUserQuota(userName);
             long newQuota = currQuota + reqFileSize;
             long maxQuota = getMaxUserQuota(userName);
             if (newQuota > maxQuota)
                 {
                 errAbort("File '%s' is too large, need %s free space but current used space is %s out of %s", reqFileName, prettyFileSize(reqFileSize), prettyFileSize(currQuota), prettyFileSize(maxQuota));
                 }
-            char *reqFileType = jsonQueryString(req, "", "Event.Upload.MetaData.filetype", NULL);
+            char *reqFileType = jsonQueryString(req, "", "Event.Upload.MetaData.fileType", NULL);
             if (!isFileTypeRecognized(reqFileType))
                 {
                 errAbort("File type '%s' for file '%s' is not accepted at this time", reqFileType, reqFileName);
                 }
             char *reqGenome = jsonQueryString(req, "", "Event.Upload.MetaData.genome", NULL);
             if (!reqGenome)
                 {
                 errAbort("Genome selection '%s' for file '%s' is invalid. Please choose the correct genome", reqGenome, reqFileName);
                 }
             }
 
         // we've passed all the checks so we can return that we are good to upload the file
         if (exitStatus == 0)
             fillOutHttpResponseSuccess(response);
         }