Document Library Preview Web Part Not Uploading

%3CLINGO-SUB%20id%3D%22lingo-sub-175954%22%20slang%3D%22en-US%22%3EDocument%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-175954%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20no%20longer%20able%20to%20upload%20files%20with%20the%20Document%20Library%20Preview%20web%20part.%20Anyone%20else%20having%20this%20issue.%20I%20know%20it's%20in%20preview%20but%20if%20I%20can't%20upload%20can%20I%20at%20least%20hide%20the%20upload%20button%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-251572%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-251572%22%20slang%3D%22en-US%22%3E%3CP%3EUpload%20works%20fine%20for%20me.%3C%2FP%3E%3CP%3EAlthough%20the%20Replace%20existing%20file%20function%20does%20not.%3CBR%20%2F%3EError%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F49547i5613AF16901E48CB%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%22Error%20at%20Replace%20existing%20file%20when%20Upload%20in%20Document%20library%20web%20part%20(Preview).png%22%20title%3D%22Error%20at%20Replace%20existing%20file%20when%20Upload%20in%20Document%20library%20web%20part%20(Preview).png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESupposedly%20fixed%20when%20web%20part%20is%20GA.%3C%2FP%3E%3CP%3EOr%20users%20need%20to%20goto%20Library%20and%20upload%20for%20Replace%20to%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-191573%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-191573%22%20slang%3D%22en-US%22%3EThis%20did%20not%20work%20for%20me.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-181850%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181850%22%20slang%3D%22en-US%22%3E%3CP%3ESeeing%20the%20same%2C%20indeed%20was%20about%20to%20post.%20What%20you%20can%20do%20is%20select%20the%20Document%20Library%20in%20the%20navigation%20and%20upload%20there%2C%20for%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-179318%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-179318%22%20slang%3D%22en-US%22%3E%3CP%3EAlso%20having%20this%20issue%2C%20but%20we%20need%20the%20upload%20feature%2C%20we%20don't%20want%20to%20hide%20it.%20MS%20Article%20says%20the%20web%20part%20can%20upload%20files%2C%20is%20this%20a%20function%20available%20to%20%22Targeted%20Release%22%20only%20or%20is%20it%20a%20settings%20thing%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHoping%20someone%20from%20MS%20can%20help%20answer%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fuse-the-document-library-web-part-a9dfecc3-2050-4528-9f00-2c5afc5731b0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fuse-the-document-library-web-part-a9dfecc3-2050-4528-9f00-2c5afc5731b0%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-177472%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-177472%22%20slang%3D%22en-US%22%3E%3CP%3EUpdated%20code%20to%20work%20in%20IE%20and%20Chrome%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3E%40%3C%2FSPAN%3E%3CSPAN%3Eoverride%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3Epublic%3C%2FSPAN%3E%3CSPAN%3EonInit%3C%2FSPAN%3E%3CSPAN%3E()%3C%2FSPAN%3E%3CSPAN%3E%3A%3C%2FSPAN%3E%3CSPAN%3EPromise%3C%2FSPAN%3E%3CSPAN%3E%26lt%3B%3C%2FSPAN%3E%3CSPAN%3Evoid%3C%2FSPAN%3E%3CSPAN%3E%26gt%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20Log.info(LOG_SOURCE%2C%20%60Initialized%20%24%7Bstrings.Title%7D%60)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20let%20message%3A%20string%20%3D%20this.properties.testMessage%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20if%20(!message)%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20message%20%3D%20'(No%20properties%20were%20provided.)'%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20Dialog.alert(%60Hello%20from%20%24%7Bstrings.Title%7D%3A%5Cn%5Cn%24%7Bmessage%7D%60)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20(()%20%3D%26gt%3B%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%2F**%20hack%20styles%20for%20the%20pagination%20buttons%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20const%20style1%20%3D%20document.createElement('style')%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20style1.innerText%20%3D%20%60%20%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20.detailsListCellName%20a.ms-Link%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20color%3A%20%23fff%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%7D%20%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20.ms-Link%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20color%3A%23fff%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%7D%20%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20.ms-CommandBar%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20display%3Anone%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%60%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20style1.setAttribute('target'%2C%20'pagination')%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20document.head.appendChild(style1)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2F%20%7D)()%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3Evar%3C%2FSPAN%3E%3CSPAN%3Esheet%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3Edocument%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EcreateElement%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E'style'%3C%2FSPAN%3E%3CSPAN%3E)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3Esheet%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EinnerHTML%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%3CSPAN%3E%60%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20.detailsListCellName%20a.ms-Link%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20color%3A%20%23fff%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20%7D%20%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20.ms-Link%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20color%3A%23fff%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20%7D%20%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20.ms-CommandBar%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20display%3Anone%20!important%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%7D%60%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3Edocument%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Ebody%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3EappendChild%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3Esheet%3C%2FSPAN%3E%3CSPAN%3E)%3B%20%3C%2FSPAN%3E%3CSPAN%3E%2F%2F%20append%20in%20body%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%2F%2Fdocument.head.appendChild(sheet)%3B%20%2F%2F%20append%20in%20head%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3Ereturn%20Promise.resolve()%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3E%20%7D%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-176970%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-176970%22%20slang%3D%22en-US%22%3E%3CP%3EI%20ended%20up%20creating%20an%20Application%20Customizers%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eextension.%20Use%20the%20code%20below%20on%20the%20public%20OnInit%20method%20to%20inject%20CSS%20to%20change%20the%20link%20color%20and%20hide%20the%20upload%20toolbar.%20I%20needed%20the%20link%20color%20white%20on%20my%20dark%20theme.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%40override%3CBR%20%2F%3Epublic%20onInit()%3A%20Promise%3CVOID%3E%20%7B%3CBR%20%2F%3E%2F%2F%20Log.info(LOG_SOURCE%2C%20%60Initialized%20%24%7Bstrings.Title%7D%60)%3B%3C%2FVOID%3E%3C%2FP%3E%0A%3CP%3E%2F%2F%20let%20message%3A%20string%20%3D%20this.properties.testMessage%3B%3CBR%20%2F%3E%2F%2F%20if%20(!message)%20%7B%3CBR%20%2F%3E%2F%2F%20message%20%3D%20'(No%20properties%20were%20provided.)'%3B%3CBR%20%2F%3E%2F%2F%20%7D%3C%2FP%3E%0A%3CP%3E%2F%2F%20Dialog.alert(%60Hello%20from%20%24%7Bstrings.Title%7D%3A%5Cn%5Cn%24%7Bmessage%7D%60)%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E(()%20%3D%26gt%3B%20%7B%3CBR%20%2F%3E%2F**%20hack%20styles%20for%20the%20document%20library%20preview%20links%20and%20hide%20upload%20toolbar%20*%2F%3CBR%20%2F%3Econst%20style1%20%3D%20document.createElement('style')%3B%3CBR%20%2F%3Estyle1.innerText%20%3D%20%60%20%3CBR%20%2F%3E.detailsListCellName%20a.ms-Link%20%7B%3CBR%20%2F%3Ecolor%3A%20%23fff%3B%3CBR%20%2F%3E%7D%20%3CBR%20%2F%3E.ms-CommandBar%20%7B%3CBR%20%2F%3Edisplay%3Anone%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%60%3B%3CBR%20%2F%3Estyle1.setAttribute('target'%2C%20'pagination')%3B%3CBR%20%2F%3Edocument.head.appendChild(style1)%3B%3CBR%20%2F%3E%7D)()%3B%3CBR%20%2F%3Ereturn%20Promise.resolve()%3B%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-176686%22%20slang%3D%22en-US%22%3ERe%3A%20Document%20Library%20Preview%20Web%20Part%20Not%20Uploading%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-176686%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20I%20have%20this%20issue%20too.%20Even%20for%20something%20in%20preview%2C%20not%20being%20able%20to%20upload%20to%20a%20document%20library%20is%20pretty%20basic.%20Does%20Microsoft%20want%20us%20to%20use%20this%20new%20experience%3F!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am no longer able to upload files with the Document Library Preview web part. Anyone else having this issue. I know it's in preview but if I can't upload can I at least hide the upload button?

7 Replies
Highlighted

Yes, I have this issue too. Even for something in preview, not being able to upload to a document library is pretty basic. Does Microsoft want us to use this new experience?!

Highlighted

I ended up creating an Application Customizers extension. Use the code below on the public OnInit method to inject CSS to change the link color and hide the upload toolbar. I needed the link color white on my dark theme.

 

@override
public onInit(): Promise<void> {
// Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

// let message: string = this.properties.testMessage;
// if (!message) {
// message = '(No properties were provided.)';
// }

// Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`); 

(() => {
/** hack styles for the document library preview links and hide upload toolbar */
const style1 = document.createElement('style');
style1.innerText = `
.detailsListCellName a.ms-Link {
color: #fff;
}
.ms-CommandBar {
display:none;
}
`;
style1.setAttribute('target', 'pagination');
document.head.appendChild(style1);
})();
return Promise.resolve();
}

Highlighted

Updated code to work in IE and Chrome

 

@override
public onInit(): Promise<void> {
// Log.info(LOG_SOURCE, `Initialized ${strings.Title}`);

// let message: string = this.properties.testMessage;
// if (!message) {
// message = '(No properties were provided.)';
// }

// Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`);

// (() => {
// /** hack styles for the pagination buttons */
// const style1 = document.createElement('style');
// style1.innerText = `
// .detailsListCellName a.ms-Link {
// color: #fff !important;
// }
// .ms-Link {
// color:#fff !important;
// }
// .ms-CommandBar {
// display:none !important;
// }
// `;
// style1.setAttribute('target', 'pagination');
// document.head.appendChild(style1);
// })();

var sheet = document.createElement('style');
sheet.innerHTML = `
.detailsListCellName a.ms-Link {
color: #fff !important;
}
.ms-Link {
color:#fff !important;
}
.ms-CommandBar {
display:none !important;
}`;
document.body.appendChild(sheet); // append in body
//document.head.appendChild(sheet); // append in head

return Promise.resolve();
}
Highlighted

Also having this issue, but we need the upload feature, we don't want to hide it. MS Article says the web part can upload files, is this a function available to "Targeted Release" only or is it a settings thing?

 

Hoping someone from MS can help answer?

 

https://support.office.com/en-us/article/use-the-document-library-web-part-a9dfecc3-2050-4528-9f00-2...

 

 

Highlighted

Seeing the same, indeed was about to post. What you can do is select the Document Library in the navigation and upload there, for now.

 

Highlighted
This did not work for me.
Highlighted

Upload works fine for me.

Although the Replace existing file function does not.
Error:

Error at Replace existing file when Upload in Document library web part (Preview).png

 

 

Supposedly fixed when web part is GA.

Or users need to goto Library and upload for Replace to work.