Displaying uploaded file form another URL

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
aspsteve
User
Posts: 52

Displaying uploaded file form another URL

Post by aspsteve »

I have two projects with a common databsae but but two separate URLS for different user groups

My Server Directory Structure is as below

C:\inetpub\wwwroot\app\domain1

C:\inetpub\wwwroot\app\domain2

I want all uploaded files from domain1 and domain2 to be saved to the same upload folder C:\inetpub\wwwroot\app\domain1\uploads\files

I have set up the File Upload Folder on project 1 on domain1.com as

uploads/files/

While I set the the File Upload Folder on project 2 as domain2.com as

../../domain1/uploads/files/

When I try to access the files uploaded from dmoain 2 from Domain 1 iget a blank screen with the this long link

http://domain1.com/api/jupload?id=x_AttachementUpload&table=InvoiceReceiptStaging&x_AttachementUpload=FileUploadTesting_1.pdf&download=1&__RequestVerificationToken=CfDJ8KainWds_NVPqI8gOulSBrVM6Ag_X47rv6H29DphtKsC6aRNdqJDpr3M1TTuWXuyvEh83IndVjUD6s3uzovTp0b7wfOBmUv8WffDJ5nCvsFC8NPZcxnVPPW32sHxOlnae6-fKsGXs3FNCZ2p_gWLBFB3LdXXn9354EHipRcXPqKxZmjmrjRBts6yg3D_TEtPbw

How can I fix this?


MichaelG
User
Posts: 1110

Post by MichaelG »

aspsteve wrote:

My Server Directory Structure is as below
C:\inetpub\wwwroot\app\domain1
C:\inetpub\wwwroot\app\domain2
I have set up the File Upload Folder on project 1 on domain1.com as
uploads/files/

That means your real upload path is C:\inetpub\wwwroot\app\domain1\wwwroot\uploads\files\

aspsteve wrote:

While I set the the File Upload Folder on project 2 as domain2.com as
../../domain1/uploads/files/

Double check if the above path is correct.


aspsteve
User
Posts: 52

Post by aspsteve »

Thank you the above filepath worked.


darkdragon
User
Posts: 150

Post by darkdragon »

You could also make use of symbolic links for each "upload" folder, pointing to another drive/disk or even an UNC path (network share)
See the command mklink /? in command prompt.

In this way you can keep uploaded data completely safe.
E.g., deleting the uploads folder, will delete the symbolic link, only.


Post Reply