You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2022/08/31 15:53:22 UTC

[GitHub] [guacamole-server] mike-jumper commented on a diff in pull request #367: GUACAMOLE-1536: return file size and file permission information when uploading files and displaying file directories

mike-jumper commented on code in PR #367:
URL: https://github.com/apache/guacamole-server/pull/367#discussion_r959756238


##########
src/common-ssh/sftp.c:
##########
@@ -653,10 +654,19 @@ static int guac_common_ssh_sftp_ls_ack_handler(guac_user* user,
 
         /* Determine mimetype */
         const char* mimetype;
-        if (LIBSSH2_SFTP_S_ISDIR(attributes.permissions))
-            mimetype = GUAC_USER_STREAM_INDEX_MIMETYPE;
-        else
-            mimetype = "application/octet-stream";
+        //adding file size and permission
+        char tmpstr[150];
+	if (LIBSSH2_SFTP_S_ISDIR(attributes.permissions)) {
+		sprintf(tmpstr, "{\"mime\":\"%s\",\"size\":%llu,\"perm\":%lu}",

Review Comment:
   We use the various internal `guac_common_json_*()` functions like `guac_common_json_write_property()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org