Jump to content

Search the Community

Showing results for tags 'internal'.

  • 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 all, I got a Internal Server Error when accessing de /setup/fields in my back end... Also when i try to reach it through the page tree, i can't edit the 'fields' page, same error. I do modify a image field through the api, i don't know if that has something to do with it, below the code i use to upload an image through the api, I deleted the parts that are not important. If anyone can help me that would be great. To clarify; the code below works fine, my image and page is created as expected, the only thing is that I can't access my /setup/fields/ page in my CMS anymore due to the Internal Server Error. <?php if($input->post->submit) { $photoPage = new Page(); // create new page object $photoPage->template = 'photo'; // set template $photoPage->parent = wire('pages')->get('/foto/'); // set the parent $photoPage->name = urlBuilder($input->title_photo); // give it a name used in the url for the page $photoPage->title = $input->title_photo; // set page title (not neccessary but recommended) $photoPage->save(); // next: process photo upload // Set a temporary upload location where the submitted files are stored during form processing $upload_path = $config->paths->assets . "files/photos/"; // New wire upload $file_upload = new WireUpload('file_upload'); // References the name of the field in the HTML form that uploads the photo $file_upload->setMaxFiles(1); $file_upload->setOverwrite(true); $file_upload->setDestinationPath($upload_path); $file_upload->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); // execute upload and check for errors $files = $file_upload->execute(); // Run a count($files) test to make sure there are actually files; if so, proceed; if not, generate getErrors() if(!count($files)) { $file_upload->error("Sorry, but you need to add a photo!"); return false; } //success //echo 'photos stored';exit; $photoPage->save(); //$session->redirect($locationPage->url); } else { ?> <section class="add-location"> <div class="container"> <div class="row"> <div class="col-xs-12"> <h2>Spot toevoegen</h2> <form id="add-form" action="" enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>" /> <div class="col-xs-12 col-md-6"> <label for="fileselect">Upload jouw foto:</label> <p> <input type="file" name="file_upload" id="file_upload" accept="image/*" class="inputfile" /> <label for="file_upload"> <span></span> <strong><i class="fa fa-upload" aria-hidden="true"></i> Kies je foto…</strong> </label> </p> </div> <input type="submit" name="submit" value="Upload" /> </div> </form> </div> </div> </div> </div> <?php } } include('./includes/foot.php');?>
×
×
  • Create New...