Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Fatal Error when attempting to upload


Go to End


2 Posts   2136 Views

Avatar
Bryce

Community Member, 2 Posts

27 January 2009 at 1:05pm

Migrated site form local development machine, to webhost (quadrahost.com.au - suggested webhost) and am unable to upload files using asset admin. Ive checked the permissions on assets folder (and subfolders) and they allow the correct permissions. Turned on dev mode which reports the following error:

FATAL ERROR: copy(/hsphere/local/home/over50/overfifty.com.au/assets/SilverStripeLogo.png): failed to open stream: Permission denied
At line 232 in /hsphere/local/home/over50/overfifty.com.au/sapphire/filesystem/Folder.php

copy(/var/tmp//silverstripe-cache-hsphere-local-home-over50-overfifty.com.au/SilverStripeLogo.png,/hsphere/local/home/over50/overfifty.com.au/assets/SilverStripeLogo.png)
line 232 of Folder.php

Folder->addUploadToFolder(Array)
line 200 of AssetAdmin.php

AssetAdmin->doUpload(Array,Form)
line 238 of Controller.php

Controller->run(Array)
line 104 of Director.php

Director::direct(admin/assets/index/0)
line 158 of main.php

Context
Debug (Debug::showError() in line 180 of Debug.php)

tmpFile =
name = SilverStripeLogo.png
type = image/png
tmp_name = /var/tmp//silverstripe-cache-hsphere-local-home-over50-overfifty.com.au/SilverStripeLogo.png
error = 0
size = 12162
base = /hsphere/local/home/over50/overfifty.com.au
file = assets/SilverStripeLogo.png

FATAL ERROR: File::loadUploaded: Couldn't copy '/var/tmp//silverstripe-cache-hsphere-local-home-over50-overfifty.com.au/SilverStripeLogo.png' to 'assets/SilverStripeLogo.png'
At line 236 in /hsphere/local/home/over50/overfifty.com.au/sapphire/filesystem/Folder.php

user_error(File::loadUploaded: Couldn't copy '/var/tmp//silverstripe-cache-hsphere-local-home-over50-overfifty.com.au/SilverStripeLogo.png' to 'assets/SilverStripeLogo.png',256)
line 236 of Folder.php

Folder->addUploadToFolder(Array)
line 200 of AssetAdmin.php

AssetAdmin->doUpload(Array,Form)
line 238 of Controller.php

Controller->run(Array)
line 104 of Director.php

Director::direct(admin/assets/index/0)
line 158 of main.php

Context
Debug (Debug::showError() in line 180 of Debug.php)

tmpFile =
name = SilverStripeLogo.png
type = image/png
tmp_name = /var/tmp//silverstripe-cache-hsphere-local-home-over50-overfifty.com.au/SilverStripeLogo.png
error = 0
size = 12162
base = /hsphere/local/home/over50/overfifty.com.au
file = assets/SilverStripeLogo.png

Avatar
Terminator4

Community Member, 81 Posts

28 January 2009 at 5:51am

Give permissions to the folder (chmod 777) and make sure the main user on the web server has owner privileges