0

I recently switched servers. From shared w/ control panel to a VPS

On my old server this PHP worked:

header("Content-disposition: attachment; filename= 'welcome.doc'");
header('Content-type: application/msword');
readfile("/home/abcme/aboveroot/admin/welcome.doc");

The same folder structure exists in the new serve. There is a folder above home named aboveroot and a folder in that called admin and a file in that called welcome.doc

I changed the /home/abcme so that "abcme" is the correct new accountname

Now I get an error saying the file cannot be found. Is there something that needs to be enabled in my server or what else might explain this?

user187680
  • 663
  • 1
  • 6
  • 20

1 Answers1

0

Based on what you said the structure would be like so:

>aboveroot 
  -home
  -admin
    -welcome.doc

So your header would say (assuming that /aboveroot is your webroot, which doesn't seem the case given the name):

header("Content-disposition: attachment; filename= 'welcome.doc'");
header('Content-type: application/msword');
readfile("/aboveroot/admin/welcome.doc");
Dean Grell
  • 143
  • 8