Jump to content

Search the Community

Showing results for tags 'image upload js'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi there, im trying to add images to a page. The data is send via ajax to the php. The php gets the local image urls. They look like: data:image/png;base64,iVBORw0KGgo... Now i try to write the images to to page like this: foreach ($item_images as $image) { $p->images->add($image); } Where $item_images is a array send via js with the local image urls. This causes a Error: <b>Fatal error</b>: Call to a member function add() on null in ... So im unsure if images->add expects another data format than this local image url (see above). Or im doing somthing wrong or this is totaly wrong and i have to use WireUpload?. Full php: <?php require_once '../index.php'; $item_titel = $_GET["item_titel"]; $item_client = $_GET["item_client"]; $item_date = $_GET["item_date"]; $item_usecase = $_GET["item_usecase"]; $item_images = $_GET["item_images"]; $item_text = $_GET["item_text"]; $targetPage = "/items/"; $p = new Page(); $p->template = 'item'; $p->parent = wire('pages')->get($targetPage); $p->title = $item_titel; $p->item_titel = $item_titel; $p->item_client = $item_client; $p->item_date = $item_date; $p->of(true); foreach ($item_images as $image){ $p->images->add($image); // $image looks like: data:image/png;base64,iVBORw0KGgo... } $p->item_text = $item_text; $p->save(); $p->of(false); Any help is very much appreciated .) cheers Simon
×
×
  • Create New...