638 // PUT on collections is not allowed |
638 // PUT on collections is not allowed |
639 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
639 protocol_status(sn, rq, PROTOCOL_METHOD_NOT_ALLOWED, NULL); |
640 return REQ_ABORTED; |
640 return REQ_ABORTED; |
641 } |
641 } |
642 |
642 |
643 SYS_FILE fd = vfs_open(vfs, path, O_RDONLY | create_file); |
643 SYS_FILE fd = vfs_open(vfs, path, O_WRONLY | create_file); |
644 if(!fd) { |
644 if(!fd) { |
645 // if it fails, vfs_open sets http status code |
645 // if it fails, vfs_open sets http status code |
646 return REQ_ABORTED; |
646 return REQ_ABORTED; |
647 } |
647 } |
648 |
648 |