1

I have a simple powershell script that invokes file upload into the context item:

Receive-File -ParentItem (get-item .)

If I try to upload existing file (name of the item exists in the same folder) it should show the warning message. This message is shown if I just use Upload File interface of Content Editor. But in my case, the dialog box is broken and there is a JS error in console:

Uncaught ReferenceError: scForm is not defined

enter image description here

I was not able to find any similar reports but it is reproducible on my local env and on Azure as well. Sitecore XP 10.1.2 (rev. 006578)

1

1 Answer 1

0

You can try adding Overwrite option to the receive-file command as below.

Receive-File -ParentItem (get-item .) -Overwrite

Hope it helps.

3
  • Thing is that I do not need to allow overwrites. I need to show a message to a user that item already exists Mar 26 at 18:05
  • Reason for the error is duplicate file names are prevented on the same level. You can modify the OnLoad method inside Spe.Client.Applications.UploadFile.PowerShellUploadFilePage2 to achieve the same.
    – ckhanna
    Mar 26 at 18:49
  • My issue is not the error, but the broken error popup Mar 26 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.