goldsky / FileDownload-R

FileDownload snippet for MODX revolution
12 stars 7 forks source link

Path goes too far back #26

Closed fivestarenemy closed 9 years ago

fivestarenemy commented 10 years ago

When I upload a file it doesn't link to my domain directly. It breaks because it's going all the way back to my root folder (my Modx site is in a sub folder with my other domain pointing to it).

The file paths look like:

http://www.domain1.com/home3/rootfolder/public_html/domain2folder/assets/portfolio/print.pdf

I have been trying to get it to look like this: http://www.domain2.com/assets/portfolio/print.pdf

All my other packages work fine with this. How can I correct this?

goldsky commented 10 years ago

Whats ur snippet's call?

fivestarenemy commented 10 years ago

[[!FileDownload? &getDir=[[++core_path]]downloads,[[++base_path]]assets/portfolio/print &noDownload=1 &browseDirectories=1]]

fivestarenemy commented 10 years ago

Is this a bug? Or is it something wrong with my code/settings?

goldsky commented 10 years ago

hhmm... is the other domain in the same server? Is it just a subdomain? In my test in subdomain, it works just fine. http://revo.virtudraft.com/filedownload-r/filedownload-basic

fivestarenemy commented 10 years ago

I do have two domains. The server I'm renting has a domain controlling the root. I have a sub directory for my domain. For some reason it wants to go past my directory.

goldsky commented 10 years ago

I don't think file browsing is allowed through cross-domain. Do you mind to email me directly to elaborate your case? goldsky.milis at gmail nospam dot com

thanks.

fivestarenemy commented 10 years ago

Okay. I found out what my problem was.

I used: &getDir`[[++core_path]]assets/files/downloads, [[++base_path]]assets/files/downloads, assets/files']]

Changed it to:

&getDir=[[++core_path]]files/downloads,[[++base_path]]assets/files/downloads, assets/files]]

I guess the core_path didn't like me being identical to the base_path.