jamesbolitho / silverstripe-frontenduploadfield

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Works on local but not on server

nimeso opened this issue · comments

Hi ya!

Firstly, thank you for all your hard work.

I've got an issue using this on my server. It works fine on my xampp localhost but not on my server. I'm not a server geek so I have no idea what could be wrong. If I look at the Chrome dev tools 'Network' I can see that they look quite different. See screengrab. Have you got any idea what is going wrong here? I'm happy to pay for your time or any advice.

server-diffs

Hi Nimeso,

It is difficult to say what is happening with the information you have posted. I am afraid I cannot claim to be a server expert either! However, I would try the following to see if you can diagnose the issue on your live server if you haven’t already tried it:

  1. Can you upload a file on the remote server in the admin area using the default upload field?
  2. Have you set an upload folder through ‘setFolderName’ config on your frontend upload field? If so does the folder exist on your live server under the Files tab?
  3. Try debugging by temporarily enabling display_errors in your PHP configuration and also set SS_ENVIRONMENT_TYPE to dev in .env file for it to display errors. The caveat here is do this at your own risk and I wouldn’t recommend doing this on a live site but you may have discrepancies between your local server config and your remote server config so this may help you align your setup. Anyway upload a file using the upload field and see what response you get on Chrome dev tools under the response tab and this might help you diagnose what is going on.

What version of Silverstripe are you running?

Thanks,

James

Fixed it! I had a few php files that had a blank line above <?PHP
Seems the server is quite fussy.

Thank you so much for your time James. Keep up the great work.

Jamie

Ah great to know you got it fixed Jamie and you are welcome.