CKEditor image upload - getting the upload file - file

I was working on a very simple and fast image uploader for CKEditor. It works all like a charm, the only problem now is the actual upload. I thought it would all be easy, but now I am stuck.
I have the CK file-field and figured I could just run an ajax request to my php uploading script, the problem is now: how do i get the file data to upload it. The Ajax does not have the post values, so I am lost.
Please lead me into the right direction.
Thanks very much.

When you use Ajax to post the form, your file upload function should be able to get the values from the form as usual.
For example, see this article: http://www.finalwebsites.com/forums/topic/php-ajax-upload-example

Well, i now used an iFrame with the form in it. Using uplodify in the iframe it put the path to the file in a hidden input which I can extract from the frame and use as the src form my image in CKEditor.

Related

Images not showing in React where the src is correct

Hey I have a weird issue in react images. Some images are not showing and some are showing.
This is my simple implementation:
<img src={item?.media?.url} />
and when I check the console and then copy the src, the image opens normally. So the url isn't the problem
Looks like you're trying to hotlink an Instagram image.
You can try downloading the image and then displaying it, or you can just embed the Instagram post
It seems your URL is broken, cause the way your using it is correct, make sure by clicking on the link, a new tab should open showing the actual image
And make sure the extension of the image is being added, cause on the image that you shared, there is no valid image extension in the URL (.png, .jpg, etc..)

display and save a local image into database in react js

I'am developing a blog website using react.js where users can post and comment ...
so we know that a user can comment with an image ,and let's say he want to upload a local image that stored in his machine,i want to display that image as a comment and save it into postgres database which i'am using for that.
My question is what are the steps that i should follow to achieve my purpose,thanks in advance.
If you have to do in simple steps, you can save the image to base64, its just string representation of an image. So it can be saved in DB directly and when you have to show it just decode the string and display it accordingly.
References :-
https://github.com/dankogai/js-base64#readme
https://scotch.io/tutorials/how-to-encode-and-decode-strings-with-base64-in-javascript
Alternatively, what you can do when user selects an image, then upload that image to your server and get the path to that(multipart file upload) and from path you can show it where you want to show.
References :-
how to send a multipart/form-data from React.js with an image?
I hope it helps, Thanks :)

Jade expression to render image from url sends another request to the server

I have a jade file, where I parse the user data and construct the page. There is a place in this file where I loop through the users' images and render them to the page:
.picture-item(ng-repeat='m in userProfile.media')
img.picture(src='{{m.mediaUrl}}')
But the problem is, even though this line of code shows the image on the page, it send another request to server like below:
http://localhost:3000/%7B%7Bm.mediaUrl%7D%7D
This happens on: http://localhost:3000/profile page. If I go to a user's profile, let's say: http://localhost:3000/profile/some_username, then the code above sends a request like:
http://localhost:3000/profile/%7B%7Bm.mediaUrl%7D%7D
m.mediaUrl are user's instagram image urls.
What could be the problem here? Any ideas?
Thanks in advance.
You are running into a known issue with AngularJS client side late binding.
You can use another attribute for the img tag instead:
https://docs.angularjs.org/api/ng/directive/ngSrc
.picture-item(ng-repeat='m in userProfile.media')
img.picture(ngSrc='{{m.mediaUrl}}')

Using CakePDF Image not showing

I am using CakePHP 2.3.6. I setup everything alright, bootstrap & core files are ok.
Now, the pdf file is generating nicely, but it doesn't have any image. But, my view file has an image, because I want that image in my generated pdf file.
I tried using fullbase=>true, but still my image is not showing in the pdf file
Can anyone help me ?
Thanks
Ok, I got a solution to this. Search for the following line
def("DOMPDF_ENABLE_REMOTE",false);
Make the line like bellow
def("DOMPDF_ENABLE_REMOTE",true);

Problems uploading blobs onto App Engine

Hi i'm trying to upload some mp3s as blobs using the Complete Sample App code provided in the App Engine tutorial here and i'm getting the following error `HTTP ERROR 404
Problem accessing /_ah/upload/ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM. Reason:
No upload session: ag5jb2xsZWN0aXZlZ3dhcHIbCxIVX19CbG9iVXBsb2FkU2Vzc2lvbl9fGHQM`
Anyone have any ideas why i'm getting this? Tried running locally and even tried deploying the App and still having issues!
Do not press the back botton and try to upload file.Use to hit the url in browser every time.
For each upload of file to the blob, the blob url is unique. For the first time, when you upload a file, you might be creating one blob url, using
blobstoreService.createUploadUrl("/yourServerURL");
Now, when you try to upload next file, you are clicking back button and you are trying to use the same blob session which you have created for the first file. That is the reason, you are facing the "No upload Session" error.
The solution could be, you can create a new blob url when you click the back button. Do some work around to create a new blob url upon clicking the back button.
Hope this helps.
Thanks.
Seems to be a bug with SDK 1.4.3
This seems to work just fine with SDK 1.4.2
Does this resolve your problem?

Categories

Resources