vmware / pyvmomi-community-samples

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

Upload file to datastore #732

Closed elungu3 closed 10 months ago

elungu3 commented 10 months 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 10 months 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 10 months 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!