[GH-ISSUE #89] Can't see images after upload #80

Closed
opened 2026-02-26 01:35:06 +03:00 by kerem · 17 comments
Owner

Originally created by @DonLafferty on GitHub (Sep 30, 2014).
Original GitHub issue: https://github.com/JLiscom/OpenNote/issues/89

I can upload images and they are in the uploads folder but all I see in the CK Editor is a broken image icon. If I rename the files in upload to have the old file type (jpg) I can see them and open them in an image program.

I'm wondering if this is an OpenNote issue or a CK Editor issue. All I know for sure is i would like to use this but I can't unless I can import images.

Originally created by @DonLafferty on GitHub (Sep 30, 2014). Original GitHub issue: https://github.com/JLiscom/OpenNote/issues/89 I can upload images and they are in the uploads folder but all I see in the CK Editor is a broken image icon. If I rename the files in upload to have the old file type (jpg) I can see them and open them in an image program. I'm wondering if this is an OpenNote issue or a CK Editor issue. All I know for sure is i would like to use this but I can't unless I can import images.
kerem 2026-02-26 01:35:06 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty We rename the image to a GUID on the disk. Can you look on the disk and see if the file was saved?

<!-- gh-comment-id:57355773 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty We rename the image to a GUID on the disk. Can you look on the disk and see if the file was saved?
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

Yes the file was saved. I must not have been clear in my post. There is a file in the upload folder and there is also an entry in my mysql table showing the filename, the original filename, and the GUID.

When I look at the source by clicking the View Source tab I also see the new filename.

But I also notice when I select it to upload it there is no preview of the file I'm trying to upload. I see a red X and a bunch of lorem ipsum filler.

<!-- gh-comment-id:57363563 --> @DonLafferty commented on GitHub (Sep 30, 2014): Yes the file was saved. I must not have been clear in my post. There is a file in the upload folder and there is also an entry in my mysql table showing the filename, the original filename, and the GUID. When I look at the source by clicking the View Source tab I also see the new filename. But I also notice when I select it to upload it there is no preview of the file I'm trying to upload. I see a red X and a bunch of lorem ipsum filler.
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty Can you make a copy the file on disk and add a .jpg extension to see if it is a valid jpg?Then try seeing if you can you can download the file by formatting it a a href?

Can you also give me the return code from the console when you try to upload?

What browser are you using?

<!-- gh-comment-id:57365808 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty Can you make a copy the file on disk and add a .jpg extension to see if it is a valid jpg?Then try seeing if you can you can download the file by formatting it a a href? Can you also give me the return code from the console when you try to upload? What browser are you using?
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

I did change the extension and it was a valid jpg.

I am using Chrome but I tried it with IE just to see and that was no better. I could always try Firefox if you wanted.

I'm not quite sure what you mean when you say the return code from the console. Do you want me to open the browser console or???

<!-- gh-comment-id:57366280 --> @DonLafferty commented on GitHub (Sep 30, 2014): I did change the extension and it was a valid jpg. I am using Chrome but I tried it with IE just to see and that was no better. I could always try Firefox if you wanted. I'm not quite sure what you mean when you say the return code from the console. Do you want me to open the browser console or???
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty Ya if you press F12 and go into the console tab, try uploading an image and see if a error is thrown.

<!-- gh-comment-id:57367317 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty Ya if you press F12 and go into the console tab, try uploading an image and see if a error is thrown.
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty If you give me your install url I can try it.

<!-- gh-comment-id:57368165 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty If you give me your install url I can try it.
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.

That was the error.

I also see it's putting the link as localhost/opennotes/Service/file/{GUID here} but the file is ending up in the localhost/opennotes/Service/upload/ folder.

<!-- gh-comment-id:57368305 --> @DonLafferty commented on GitHub (Sep 30, 2014): The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it. That was the error. I also see it's putting the link as localhost/opennotes/Service/file/{GUID here} but the file is ending up in the localhost/opennotes/Service/upload/ folder.
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

I'm behind a firewall unfortunately.

<!-- gh-comment-id:57368356 --> @DonLafferty commented on GitHub (Sep 30, 2014): I'm behind a firewall unfortunately.
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

In Chrome console I see this too.

GET http://192.168.254.22/opennotes/Service/file/F7B0DFCD-0126-BFDD-5CE4-6D60468C6C7A 404 (Not Found)

<!-- gh-comment-id:57368468 --> @DonLafferty commented on GitHub (Sep 30, 2014): In Chrome console I see this too. GET http://192.168.254.22/opennotes/Service/file/F7B0DFCD-0126-BFDD-5CE4-6D60468C6C7A 404 (Not Found)
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

Is it related to the fact it has both Service/upload and Service/file?

<!-- gh-comment-id:57368634 --> @DonLafferty commented on GitHub (Sep 30, 2014): Is it related to the fact it has both Service/upload and Service/file?
Author
Owner
<!-- gh-comment-id:57368732 --> @DonLafferty commented on GitHub (Sep 30, 2014): ReferenceError: entryURL is not defined at forceLogin (http://192.168.254.22/opennotes/openNote/openNote.js:57:6) at http://192.168.254.22/opennotes/openNote/openNote.js:34:11 at k.$broadcast (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:114:99) at l (http://192.168.254.22/opennotes/bower_components/angular-route/angular-route.min.js:9:497) at k.$broadcast (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:114:99) at g (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:88:274) at http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:91:131 at k.$eval (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:111:373) at k.$digest (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:108:462) at k.$apply (http://192.168.254.22/opennotes/bower_components/angular/angular.min.js:112:173) And that's there too.
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

Did you just do you install today?

Change the following line
https://github.com/FoxUSA/OpenNoteService-PHP/blob/master/Service/controller/File.php#L37
to $url = sprintf("//%s%s%s%s",$_SERVER["SERVER_NAME"],\Config::getWebRoot() ,"service.php/file/", $model->uploadFile(self::createGUID(),$originalName, $diskName, $tokenServer->userID));

<!-- gh-comment-id:57368878 --> @JLiscom commented on GitHub (Sep 30, 2014): Did you just do you install today? Change the following line https://github.com/FoxUSA/OpenNoteService-PHP/blob/master/Service/controller/File.php#L37 to `$url = sprintf("//%s%s%s%s",$_SERVER["SERVER_NAME"],\Config::getWebRoot() ,"service.php/file/", $model->uploadFile(self::createGUID(),$originalName, $diskName, $tokenServer->userID));`
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

Yes. This morning.

<!-- gh-comment-id:57368918 --> @DonLafferty commented on GitHub (Sep 30, 2014): Yes. This morning.
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty you should change the line above and re-upload a file

<!-- gh-comment-id:57369250 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty you should change the line above and re-upload a file
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

I did and it now works. Excellent!

<!-- gh-comment-id:57369339 --> @DonLafferty commented on GitHub (Sep 30, 2014): I did and it now works. Excellent!
Author
Owner

@DonLafferty commented on GitHub (Sep 30, 2014):

Thanks for all the help and very timely response.

<!-- gh-comment-id:57370536 --> @DonLafferty commented on GitHub (Sep 30, 2014): Thanks for all the help and very timely response.
Author
Owner

@JLiscom commented on GitHub (Sep 30, 2014):

@DonLafferty
Feel free to donate and/or star us on Docker, Alternative To, and git hub to support the project.

Enjoy

<!-- gh-comment-id:57371314 --> @JLiscom commented on GitHub (Sep 30, 2014): @DonLafferty Feel free to donate and/or star us on Docker, Alternative To, and git hub to support the project. Enjoy
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OpenNote-JLiscom#80
No description provided.