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.

Archive /

Our old forums are still available as a read-only archive.

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

Can't upload images


Go to End


66 Posts   403632 Views

Avatar
Carel

Community Member, 3 Posts

11 January 2008 at 12:35pm

>and you have write permissions on the folder?

Is this a different permission from "Full administrative rights" ...? That is what I have set it to at the moment. I thought that was as permissive as it gets.

Carel Struycken

Avatar
mundgold

Community Member, 19 Posts

18 January 2008 at 4:09am

I have the same Problem again in my production environment. I am not able to upload images. The folders all set to 777 - I tried it with different browsers on different os.

I get no errormessages or warnings in my logfiles.
I added the host to Director::set_dev_servers()
I turned apache save_mode off and included every required directory to open_basedir

Perhaps somebody from the coreteam could give us a hint to solve this problem

PHP Version 5.2.0
Apache/2.2.3 (Linux/SUSE)

Thanks a lot
Roland

Avatar
mundgold

Community Member, 19 Posts

18 January 2008 at 6:58am

Edited: 25/01/2008 2:31am

Hello again,

I set the debug variable in 'cms/javascript/Upload.js' line 65 to true and compared the output while I uploaded a file on my testserver and on the staging server :

The debug output of the testserver where everything works fine:

 
SWF DEBUG: UploadFile: Browsing files. *.jpeg;*.jpg;*.jpe;*.png;*.gif;
SWF DEBUG: Event: Files Selected from Dialog. Processing file list
SWF DEBUG: onSelect: File within size limit and of valid type. Adding to queue and making callback.
SWF DEBUG: onSelect: Uploads set to begin immediately. Calling StartUpload.
SWF DEBUG: StartUpload(): Starting Upload. Next file in queue
SWF DEBUG: StartFile: Next file in queue
SWF DEBUG: File Post Item: action_doUpload=undefined
SWF DEBUG: File Post Item: Files=undefined
SWF DEBUG: File Post Item: MAX_FILE_SIZE=undefined
SWF DEBUG: File Post Item: ID=undefined
SWF DEBUG: startFile(): File Reference found.  Starting upload to http://<mysite>/admin/assets/index/root?executeForm=UploadForm&SecurityID=1131280439&PHPSESSID=69d67493f47104c23503a7974de701ea. File ID: SWFUpload_0_0
SWF DEBUG: Event: Progress: File ID: SWFUpload_0_0. Bytes: 2913. Total: 2913
SWF DEBUG: Event: UploadCompleteData: File ID: SWFUpload_0_0 Data: 			<script type="text/javascript">
SWF DEBUG: 			var form = parent.document.getElementById('Form_EditForm');
SWF DEBUG: 			form.getPageFromServer(form.elements.ID.value);
SWF DEBUG: 			parent.statusMessage("1 Dateien hochgeladen","good");
SWF DEBUG: 			
SWF DEBUG: 			parent.document.getElementById('sitetree').getTreeNodeByIdx( "85" ).getElementsByTagName('a')[0].className += ' contents';
SWF DEBUG: 			</script>
SWF DEBUG: UploadComplete(): Upload complete. Removing File Reference and starting the next upload.
SWF DEBUG: StartFile: Next file in queue
SWF DEBUG: startFile(): No File Reference found.  All uploads must be complete, cancelled, or errored out.
SWF DEBUG: startFile(): Ending upload run. Completed Uploads: 1
SWF DEBUG: startFile(): Queue is

the staging output:

SWF DEBUG: UploadFile: Browsing files. *.jpeg;*.jpg;*.jpe;*.png;*.gif;
SWF DEBUG: Event: Files Selected from Dialog. Processing file list
SWF DEBUG: onSelect: File within size limit and of valid type. Adding to queue and making callback.
SWF DEBUG: onSelect: Uploads set to begin immediately. Calling StartUpload.
SWF DEBUG: StartUpload(): Starting Upload. Next file in queue
SWF DEBUG: StartFile: Next file in queue
SWF DEBUG: File Post Item: MAX_FILE_SIZE=undefined
SWF DEBUG: File Post Item: action_doUpload=undefined
SWF DEBUG: File Post Item: ID=undefined
SWF DEBUG: File Post Item: Files=undefined
SWF DEBUG: startFile(): File Reference found.  Starting upload to http://<mysite>/admin/assets/index/root?executeForm=UploadForm&SecurityID=1148967132&PHPSESSID=or=jHfUf0haPfY-nYaG7zN6i13nlPJGcIFns01nbdiQSmQ.. File ID: SWFUpload_0_0
SWF DEBUG: Event: Progress: File ID: SWFUpload_0_0. Bytes: 3046. Total: 3046
SWF DEBUG: Event: UploadCompleteData: File ID: SWFUpload_0_0 Data: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
SWF DEBUG: 
SWF DEBUG: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
SWF DEBUG: <head>
--> here  comes the whole html ouptput of the loginpage <--
SWF DEBUG: </body>
SWF DEBUG: </html>
SWF DEBUG: UploadComplete(): Upload complete. Removing File Reference and starting the next upload.
SWF DEBUG: StartFile: Next file in queue
SWF DEBUG: startFile(): No File Reference found.  All uploads must be complete, cancelled, or errored out.
SWF DEBUG: startFile(): Ending upload run. Completed Uploads: 1
SWF DEBUG: startFile(): Queue is complete and at least one file has been uploaded.  Making QueueComplete callback.

Has anybody an idea?

Thank you
Roland

Avatar
mundgold

Community Member, 19 Posts

18 January 2008 at 7:32am

Now I tried the browser-change again - and I get a interresting behaviour on IE. After upload the images I got the "login-page" in the I-Frame. Another try and it showed me an alert-box with the message "The server logged you out".

Could it be, that something destroy the session or some cookies - or perhaps isn't able to write sessions or cookies?

I have no idea - thank you for some help

Cheers Roland

Avatar
hitautodestruct

Community Member, 19 Posts

21 January 2008 at 4:32am

Hey I had a problem with uploading images.
I kept getting a strange SWFUpload error in IE7 and no error in FF2
And I managed to fix it.

Firstly I downloaded the latest version of SWFUpload and copied the entire FlashDevelop dir into:
/jsparty/SWFUpload/
That helped and I was able to upload GIF's smoothly.

BUT!

Then I got a problem with the GDLib command: imagecreatefromjpeg().
Which was being called from the /sapphire/filesystem/GD.php file.

Apparently support for this function has to be custom compiled in PHP5. So I recompiled PHP5 on my server with the command (for linux): ./configure --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib
(also added the other line for png support)

Follow this link for windows based servers: http://il2.php.net/manual/en/function.imagecreatefromjpeg.php#75184

And now all is well.
Hope this helps someone out there.

And maybe the dev team can take note that the SWFUpload script found in the basic installation of SilverStripe 2.2.1 is not the latest to date.

Avatar
mundgold

Community Member, 19 Posts

21 January 2008 at 11:28pm

I've done that. And now I am able to upload Images in the "assets" section.
But I can not upload Images or create Folders in the left sidebar of the tiny_mce any more. If I click on the Button "upload" or "create folder" I will redirected to the frontend.

Cheers Roland

Avatar
hitautodestruct

Community Member, 19 Posts

23 January 2008 at 12:15am

Try uploading from the "Files & Images" section.
That's what I do when the image pane doesn't work.
It's also more robust in terms of managing your assets files.

Avatar
mundgold

Community Member, 19 Posts

23 January 2008 at 1:02am

I've done that :-)

I called it "assets-section" instead of "files & images" in case of other translations.

Roland