Crazy ASPX page behavior in Sharepoint Online document library , getting downloaded

%3CLINGO-SUB%20id%3D%22lingo-sub-91144%22%20slang%3D%22en-US%22%3ECrazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-91144%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20two%20site%20collections%20in%20Sharepoint%20online%20and%20those%20have%20respective%20document%20libraries%20(Say%20Lib1%20(Site%20collection%201)%20and%20Lib2%20(Site%20collection%202))%3C%2FP%3E%3CP%3EWe%20have%20ASPX%20page%20on%20drive%20which%20are%20uploading%20through%20powershell%20inside%20document%20library.%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3EUpload%20through%20powershell%3C%2FP%3E%3COL%3E%3CLI%3ELib1%20%3D%20ASPX%20page%20uploads%20and%20opens%20fine%20in%20the%20browser%3C%2FLI%3E%3CLI%3ELib2%20%3D%20Same%20ASPX%20page%20uploads%20however%20it%20does%20not%20open%20in%20browser%20and%20gets%20downloaded%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3CLI%3E%3CP%3EUpload%20manually%2F%20Drag%20drop%3C%2FP%3E%3COL%3E%3CLI%3ELib1%20%3D%20ASPX%20page%20uploads%20and%20opens%20fine%20in%20the%20browser%3C%2FLI%3E%3CLI%3ELib2%20%3D%20Same%20ASPX%20page%20uploads%20and%20opens%20fine%20in%20the%20browser%3C%2FLI%3E%3C%2FOL%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EI%20am%20really%20puzzled.%20whats%20making%20Lib2%20to%20download%20the%20aspx%20page%20when%20uploaded%20through%20power-shell.%3C%2FP%3E%3CP%3EHave%20you%20seen%20such%20issue%20before%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDont%20think%20its%20an%20issue%20with%20Powershell%20script%2C%20as%20its%20working%20fine%20on%20Lib1.%3C%2FP%3E%3CP%3ENot%20issue%20with%20library%20also%2C%20as%20when%20manully%20ASPX%20is%20uploaded%20manully%20it%20opens%20fine%20in%20browser%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-91144%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-288589%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-288589%22%20slang%3D%22en-US%22%3Eafter%20setting%20the%20%22DenyAddAndCustomizePages%22%20option%20to%200.%20I%20was%20able%20to%20load%20custom%20.aspx%20pages%20from%20the%20%22Pages%22%20library.%20A%20couple%20of%20hours%20later%2C%20my%20ASPX%20pages%20ran%20also%20in%20other%20document%20libraries%E2%80%A6%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-285798%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-285798%22%20slang%3D%22en-US%22%3EI%20just%20set%20the%20flag%20%22DenyAddAndCustomizePages%22%20to%200%20via%20the%20powershell%20cmdlet%3A%3CBR%20%2F%3E%3CBR%20%2F%3ESet-SPOsite%20%3CA%20href%3D%22https%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fteamxyz%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxxx.sharepoint.com%2Fsites%2Fteamxyz%3C%2FA%3E%20-DenyAddAndCustomizePages%200%3CBR%20%2F%3E%3CBR%20%2F%3EI'll%20cross%20my%20fingers%20if%20this%20is%20working.%20The%20value%20on%20this%20flag%20is%20often%20cached.%20So%20I%20will%20check%20back%20tomorrow!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-285778%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-285778%22%20slang%3D%22en-US%22%3E%3CP%3ESame%20issue%20here.%20In%20one%20Site%20Collection%20I%20can%20view%20my%20ASPX%20pages%2C%20in%26nbsp%3Banother%20(a%20Microsoft%20Teams%20SharePoint%20site)%20the%20file%20is%20prompted%20for%20download...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-254139%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-254139%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20the%20exactly%20same%20issue%20...%3C%2FP%3E%3CP%3EAnyone%20knows%20how%20to%20solve%20this%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-92042%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-92042%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20feedback!%20Good%20to%20hear%20it%20started%20to%20work%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-92028%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-92028%22%20slang%3D%22en-US%22%3EThank%20you%20John.%20I%20feel%20stupid%20to%20say%20this%2C%20however%20this%20has%20started%20working%20now%20after%20continuous%20attempts.%20I%20have%20failed%20to%20identify%20what%20the%20issue%20was%20.%20TO%20answer%20your%20question%2C%20Content%20type%20is%20Documents%2C%20however%20not%20sure%20what%20the%20difference%20is%20between%20Uploading%20manually%20and%20through%20the%20script.%20Fortunately%20its%20working%20now.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-92025%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-92025%22%20slang%3D%22en-US%22%3EThank%20you%20Juan.%20I%20feel%20stupid%20to%20say%20this%2C%20however%20this%20has%20started%20working%20now%20after%20continuous%20attempts.%20I%20have%20failed%20to%20identify%20what%20the%20issue%20was%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-92007%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-92007%22%20slang%3D%22en-US%22%3E%3CP%3EWhich%20content%20types%20does%20the%20ASPX%20file%20get%20in%20each%20library%3F%20Are%20they%20the%20same%3F%3C%2FP%3E%3CP%3EKind%20regards%3C%2FP%3E%3CP%3EJohn%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-91379%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-91379%22%20slang%3D%22en-US%22%3EWell%2C%20I%20have%20not%20seeing%20this%20and%20it%20seems%20to%20be%20very%20weird%20according%20to%20your%20description%20of%20the%20scenario%20you%20have%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-612650%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-612650%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F140450%22%20target%3D%22_blank%22%3E%40Steven%20Derveaux%3C%2FA%3E%26nbsp%3B%20Worked%20for%20me%20too!%26nbsp%3B%20Thank%20you%20for%20posting%20this.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-918642%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-918642%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F508%22%20target%3D%22_blank%22%3E%40Rohit%20Devmore%3C%2FA%3E%26nbsp%3B-%20Thanks%20for%20your%20post.%20I%20also%20stumbled%20across%20similar%20behavior%20of%20ASPX%20file%20in%20a%20Document%20library%20in%20SharePoint%20Online.%20Initially%2C%20I%20followed%20most%20of%20the%20suggestions%20to%20solve%20this.%3C%2FP%3E%3CP%3EUnfortunately%2C%20the%20issue%20remains%20same%20-%20ASPX%20files%20are%20downloaded%20in%20all%20browsers%20instead%20of%20rendering%20in%20browser.%20Even%20if%20I%20try%20to%20access%20the%20ASPX%20file%20with%20direct%20link%20SharePoint%20show%20'Something%20went%20wrong'%20-%20'File%20not%20found'.%20Here%20is%20the%20URL%20format%20I%20tried%3A%20https%3A%2F%2F%5Btenant%5D.sharepoint.com%2Fteams%2Fteam1%2Ftestlibrary%2Fmyfile.aspx%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20my%20analysis%2C%20I%20found%20that%20the%20ASPX%20files%20should%20be%20uploaded%20by%20'%3CSTRONG%3ESite%20Owners%3C%2FSTRONG%3E'%20and%20not%20by%20the%20members%20or%20of%20the%20site.%20Once%20I%20re-uploaded%20the%20ASPX%20files%20as%20a%20'%3CSTRONG%3ESite%20Owner%3C%2FSTRONG%3E'%20using%20the%20standard%20upload%20feature%20in%20document%20library%20all%20of%20the%20ASPX%20files%20are%20being%20rendered%20in%20all%20browsers%20instead%20off%20download%20prompt.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20looks%20like%20SharePoint%20internally%20assign%20some%20internal%20flags%20for%20the%20ASPX%20files%20uploaded%20by%20%3CSTRONG%3ESite%20Owners%3C%2FSTRONG%3E.%20If%20we%20try%20to%20'Copy%20Link'%20we%20can%20see%20the%20differences%20between%20the%20files%20uploaded%20by%20Site%20Members%20and%20Site%20Owners.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20an%20example%3A%3C%2FP%3E%3CP%3ELink%20copied%20for%20file%20uploaded%20by%20Site%20Owner%20-%26nbsp%3Bhttps%3A%2F%2F%5Btenant%5D.sharepoint.com%2F%3Au%3A%2Fr%2Fteams%2Fteam1%2Ftestlibrary%2Fmyfile.aspx%3Fcsf%3D1%26amp%3Be%3Dfi6Pme%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOn%20the%20other%20hand%20link%20copied%20for%20file%20uploaded%20by%20Site%20Member%20-%26nbsp%3Bhttps%3A%2F%2F%5Btenant%5D.sharepoint.com%2Fteams%2Fteam1%2F_layouts%2F15%2Fdownload.aspx%3FUniqueId%3D%5BGUID%5D%26amp%3Be%3DZepFn%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20later%20link%20clearly%20instruct%20the%20browser%20to%20download%20the%20file.%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Fhtml%2Fimages%2Femoticons%2Fsmile_40x40.gif%22%20alt%3D%22%3Asmile%3A%22%20title%3D%22%3Asmile%3A%22%20%2F%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20saves%20my%20day.%20I%20thought%20this%20might%20help%20others%20whosoever%20face%20similar%20issues%20in%20SharePoint%20Online.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBr%2FTapan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1747637%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1747637%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F277601%22%20target%3D%22_blank%22%3E%40tapansam%3C%2FA%3E%26nbsp%3BUnfortunately%2C%20I%20don't%20believe%20this%20is%20the%20whole%20story%20as%20I%20am%20a%20member%20of%20the%20Owners%20group%20of%20a%20site%20but%20still%20cannot%20get%20aspx%20to%20run.%20I%20believe%20that%20the%20site%20must%20allow%20scripts%20to%20run%2C%20also.%20Here's%20a%20SO%20post%20that%20goes%20into%20it%20a%20little%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F237928%2Fhow-do-i-allow-the-documents-library-in-an-office-365-group-site-allow-aspx-page%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsharepoint.stackexchange.com%2Fquestions%2F237928%2Fhow-do-i-allow-the-documents-library-in-an-office-365-group-site-allow-aspx-page%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1750364%22%20slang%3D%22en-US%22%3ERe%3A%20Crazy%20ASPX%20page%20behavior%20in%20Sharepoint%20Online%20document%20library%20%2C%20getting%20downloaded%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1750364%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F821217%22%20target%3D%22_blank%22%3E%40SPWade%3C%2FA%3E%26nbsp%3BIn%20fact%2C%20let%20me%20just%20follow%20up%20on%20this%20a%20little%20more.%20Unless%20you%20have%20Allow%20Custom%20Scripts%20turned%20on%20%2F%20enabled%20for%20your%20site%20you%20are%20only%20going%20to%20be%20able%20to%20create%20a%20new%20aspx%20page%20via%20the%20UI%20(or%20Designer)%20and%20that%20page%20will%20only%20be%20allowed%20to%20run%20certain%20web%20parts%20on%20it.%20Once%20you%20try%20editing%20the%20page%20and%20putting%20any%20custom%20script%20on%20it%20(or%20just%20editing%20what's%20already%20there%20and%20adding%20a%20simple%20space%2C%20then%20saving)%2C%20it%20will%20break.%20Even%20the%20Page%20Viewer%20webpart%20is%20not%20going%20to%20work%20for%20viewing%2C%20say%2C%20an%20HTML%20page%20or%20a%203rd%20party%20page%20without%20custom%20scripts%20enabled.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EObviously%2C%20this%20is%20a%20security%20lockdown%20because%20someone%20with%20editor%20access%20to%20a%20page%20could%20put%20in%20some%20hidden%20script%20that%20acts%20on%20behalf%20of%20the%20user%20to%2C%20say%2C%20post%20some%20of%20their%20information%20to%20a%20list%20or%20activate%20a%20workflow.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20alternatives%20I%20can%20see%20are%20a)%20enable%20custom%20scripts%2C%20b)%20put%20your%20customizations%20into%20an%20Add-In%20(App)%20and%20publish%20them%20to%20the%20SP%20store%20so%20they%20are%20trusted%2C%20c)%20redirect%20the%20user%20away%20from%20SP%20to%20an%20external%20system%20that%20hosts%20the%20content%20(and%20optionally%20use%20the%20SP%20API%20to%20interact%20with%20data%20-%20again%2C%20sorta%20the%20App%20approach%20without%20the%20overhead%20of%20dealing%20with%2C%20say%2C%20SP%20admins)%2C%20or%20even%20d)%20have%20the%20user%20sync%20a%20folder%20with%20the%20content%20down%20to%20their%20local%20system%20and%20launch%20the%20content%20from%20there.%20Again%2C%20that's%20just%20another%20variation%20on%20external%20hosting.%20And%20is%20probably%20a%20nightmare%20to%20support.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOr%2C%20e)%20find%20a%20new%20environment%20to%20work%20in%20where%20you%20don't%20have%20all%20the%20ridiculous%20restrictions%20and%20vulnerabilities%20(worldwide%20MSFT%20outages%2C%20anyone%3F)%20of%20SP.%205000%20item%20list%20limits%20-%20from%201998%20-%20and%20explaining%20why%20they%20are%20ridiculous%20to%20SP%20admins%20is%20so%20fun%20and%20productive!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

We have two site collections in Sharepoint online and those have respective document libraries (Say Lib1 (Site collection 1) and Lib2 (Site collection 2))

We have ASPX page on drive which are uploading through powershell inside document library.

  1. Upload through powershell

    1. Lib1 = ASPX page uploads and opens fine in the browser
    2. Lib2 = Same ASPX page uploads however it does not open in browser and gets downloaded
  2. Upload manually/ Drag drop

    1. Lib1 = ASPX page uploads and opens fine in the browser
    2. Lib2 = Same ASPX page uploads and opens fine in the browser

I am really puzzled. whats making Lib2 to download the aspx page when uploaded through power-shell.

Have you seen such issue before?

 

Dont think its an issue with Powershell script, as its working fine on Lib1.

Not issue with library also, as when manully ASPX is uploaded manully it opens fine in browser

13 Replies
Highlighted
Well, I have not seeing this and it seems to be very weird according to your description of the scenario you have
Highlighted

Which content types does the ASPX file get in each library? Are they the same?

Kind regards

John

Highlighted
Thank you Juan. I feel stupid to say this, however this has started working now after continuous attempts. I have failed to identify what the issue was
Highlighted
Thank you John. I feel stupid to say this, however this has started working now after continuous attempts. I have failed to identify what the issue was . TO answer your question, Content type is Documents, however not sure what the difference is between Uploading manually and through the script. Fortunately its working now.
Highlighted
Thanks for the feedback! Good to hear it started to work :)
Highlighted

I have the exactly same issue ...

Anyone knows how to solve this ?

Highlighted

Same issue here. In one Site Collection I can view my ASPX pages, in another (a Microsoft Teams SharePoint site) the file is prompted for download...

Highlighted
I just set the flag "DenyAddAndCustomizePages" to 0 via the powershell cmdlet:

Set-SPOsite https://xxx.sharepoint.com/sites/teamxyz -DenyAddAndCustomizePages 0

I'll cross my fingers if this is working. The value on this flag is often cached. So I will check back tomorrow!
Highlighted
after setting the "DenyAddAndCustomizePages" option to 0. I was able to load custom .aspx pages from the "Pages" library. A couple of hours later, my ASPX pages ran also in other document libraries…
Highlighted

@Steven Derveaux  Worked for me too!  Thank you for posting this.  

Highlighted

@Rohit Devmore - Thanks for your post. I also stumbled across similar behavior of ASPX file in a Document library in SharePoint Online. Initially, I followed most of the suggestions to solve this.

Unfortunately, the issue remains same - ASPX files are downloaded in all browsers instead of rendering in browser. Even if I try to access the ASPX file with direct link SharePoint show 'Something went wrong' - 'File not found'. Here is the URL format I tried: https://[tenant].sharepoint.com/teams/team1/testlibrary/myfile.aspx

 

After my analysis, I found that the ASPX files should be uploaded by 'Site Owners' and not by the members or of the site. Once I re-uploaded the ASPX files as a 'Site Owner' using the standard upload feature in document library all of the ASPX files are being rendered in all browsers instead off download prompt.

 

It looks like SharePoint internally assign some internal flags for the ASPX files uploaded by Site Owners. If we try to 'Copy Link' we can see the differences between the files uploaded by Site Members and Site Owners.

 

Here is an example:

Link copied for file uploaded by Site Owner - https://[tenant].sharepoint.com/:u:/r/teams/team1/testlibrary/myfile.aspx?csf=1&e=fi6Pme

 

On the other hand link copied for file uploaded by Site Member - https://[tenant].sharepoint.com/teams/team1/_layouts/15/download.aspx?UniqueId=[GUID]&e=ZepFn

 

The later link clearly instruct the browser to download the file. :smile:

 

This saves my day. I thought this might help others whosoever face similar issues in SharePoint Online.

 

Br/Tapan

Highlighted

@tapansam Unfortunately, I don't believe this is the whole story as I am a member of the Owners group of a site but still cannot get aspx to run. I believe that the site must allow scripts to run, also. Here's a SO post that goes into it a little: https://sharepoint.stackexchange.com/questions/237928/how-do-i-allow-the-documents-library-in-an-off...

Highlighted

@SPWade In fact, let me just follow up on this a little more. Unless you have Allow Custom Scripts turned on / enabled for your site you are only going to be able to create a new aspx page via the UI (or Designer) and that page will only be allowed to run certain web parts on it. Once you try editing the page and putting any custom script on it (or just editing what's already there and adding a simple space, then saving), it will break. Even the Page Viewer webpart is not going to work for viewing, say, an HTML page or a 3rd party page without custom scripts enabled. 

 

Obviously, this is a security lockdown because someone with editor access to a page could put in some hidden script that acts on behalf of the user to, say, post some of their information to a list or activate a workflow.

 

The only alternatives I can see are a) enable custom scripts, b) put your customizations into an Add-In (App) and publish them to the SP store so they are trusted, c) redirect the user away from SP to an external system that hosts the content (and optionally use the SP API to interact with data - again, sorta the App approach without the overhead of dealing with, say, SP admins), or even d) have the user sync a folder with the content down to their local system and launch the content from there. Again, that's just another variation on external hosting. And is probably a nightmare to support.

 

Or, e) find a new environment to work in where you don't have all the ridiculous restrictions and vulnerabilities (worldwide MSFT outages, anyone?) of SP. 5000 item list limits - from 1998 - and explaining why they are ridiculous to SP admins is so fun and productive!