691 // PUT on collections is not allowed |
691 // PUT on collections is not allowed |
692 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
692 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
693 return REQ_ABORTED; |
693 return REQ_ABORTED; |
694 } |
694 } |
695 |
695 |
696 SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | create_file); |
696 SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | O_TRUNC | create_file); |
697 if(!fd) { |
697 if(!fd) { |
698 // if it fails, vfs_open sets http status code |
698 // if it fails, vfs_open sets http status code |
699 return REQ_ABORTED; |
699 return REQ_ABORTED; |
700 } |
700 } |
701 |
701 |