vmware / pyvmomi-community-samples

A place for community contributed samples for the pyVmomi library.
Apache License 2.0
1.02k stars 928 forks source link

Upload file to datastore #732

Closed elungu3 closed 1 year ago

elungu3 commented 1 year ago

Describe the bug

I used the sample for uploading the files to datastore (upload_file_to_datastory.py) but I get 405 HTTP Code response, even tho I have 443 HTTPS port enabled and I can access the datastore and retrive information from it using other methods from your samples.

Reproduction steps

  1. Write the code
  2. Execute the code with correct parameters
  3. 405 Method Not Allowed response

Expected behavior

200 Status code, as a response to the succesfully operation

Additional context

Please confirm with me if this issue is only on my side (and if so, could you please give me a fix?). Thanks in advance

prziborowski commented 1 year ago

I think the sample is correct. What you might need to check is whether the file exists on the datastore already, or if it is trying to do something like creating a folder as a result of the upload.

elungu3 commented 1 year ago

I think the sample is correct. What you might need to check is whether the file exists on the datastore already, or if it is trying to do something like creating a folder as a result of the upload.

Indeed is correct. It worked after I uncommented the lines 153-156. Thank you guys!