Jump to content

Edit & Add image via Page Api

Recommended Posts


i want to build a page for product add and edit. 

Products have also images. 

Is there any way i can include the image user interface like on the backend image field. Drag drop images and editing images. 


Is there any complete manual for such a page. 

Or any module for editing with page api (not frontend editing) 

Share this post

Link to post
Share on other sites

You can take a look at this module: 

Or you can build your own image uploader with something like Dropzone.js and some guide from this topic:

I think the main backend code to upload and save image to disk and add to page field is within this post: 


	if ($size > MAX_SIZE*1024){
		print 'File troppo grosso';
	//copy the image in secure folder
	$copied = copy($_FILES['imageUpload']['tmp_name'], $newname);
	if ($copied) {
		$userid	= $sanitizer->text($input->post->userid);
		$u = $users->get($userid);
                       //delete copied image
		$tmpfile = $_SERVER["DOCUMENT_ROOT"]."/site/tmpfiles/profiles/".$image_name;
		if (file_exists($tmpfile)) { unlink ($tmpfile); }

		print "Errore nel salvataggio del file.";


  • Like 1

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...