Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by qubism

  1. Any news regarding ProDrafts?
  2. Hey friends, I'm currently building a new site and switched from CKEditor to TinyMCE, which works like a charm for now. One option I'm missing from CKEditor is setting the default Image Field when uploading something to the editor. Is there a workaround to achieve the same thing with TinyMCE? Maybe I'm blind and am just missing the option. Thanks a bunch!
  3. I tried that and also rawurlencode() and the API just uploads an blank image with the whole absolute url as filename. Most images work though, so I guess that's not the problem. Another option would be to check for special characters in the filename and skip that images, so ProcessWire at least doesn't throw an error. Not optimal, but still something
  4. Hey Girls & Boys, I'm currently importing data with some basic scraping from another page and adding new pages with the ProcessWire API. The data is mostly text which works fine but some images can't get downloaded from the other page. My guess would be due to the filename. Here's the Error: ProcessWire\WireException File could not be downloaded (https://************.com/content/v1/5e8119f5232766b98/1613689-FJ73MYGC/Außenansicht+2+Galerie.jpg) 400 Bad Request: (tried: curl) search My Code snippet (throws the error also without sanitizer): if($html->find('img.thumb-image', 0)->{'data-src'}) { $image = $html->find('img.thumb-image', 0)->{'data-src'}; $p->article_thumb = $sanitizer->url($image); } Is there a way to do this? Thanks for your time ? Edit: Found a solution. urlencode changed the whole URL and made the API upload empty images. So I kept the URL until the last slash and just changed the filename like so: $image = $html->find('img.thumb-image', 0)->{'data-src'}; $imageURL = $image; $pos = strrpos($imageURL, '/') + 1; $result = substr($imageURL, 0, $pos) . urlencode(substr($imageURL, $pos));
  • Create New...