Jump to content

Search the Community

Showing results for tags 'upload'.

  • 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

  1. Hi I have an image field in the back end, that expects multiple images. Now I've added this hook as the files are added: $page->addHookAfter('InputfieldFile::fileAdded', function($event) { $inputfield = $event->object; wire('log')->save('image-resizing', "Resizing "); $image = $event->argumentsByName("pagefile"); $image->size(800,0,array('upscaling' => false)); $image->size(300,200,array('cropping' => true, 'quality' => 80 )); }); It works absolutely fine for a small amount of images, but uploading a large amount doesn't seem to work. No errors are logged either. Now all thes photos appear to have uploaded in the back end, and show the thumbnails, but upon clicking save images are missing. I've checked all my php settings and ensured they are all adequate enough. memory_limit 512mb upload_max_filesize 200mb max_execution_time 300 If I disable this hook, I can upload all images fine. Please could anyone other any insight into what may be causing this issue? Thanks in advance
  2. Hello Forum, I am relatively new to processwire and have been playing around with some simple websites so far with it. I love the simplicity and the straight forward approach to it. I felt "at home" right away! =D The only thing, I just can not get done is implementing a simple post-form in a template. (front-end) I want to get registered users to create content via a simple form. Yes, there are several tutorials in this forum. BUT: I want the file upload to look like the upload in the back-end: - multiple upload - rearrange order of files Is that hard to build? It should be "there"... or do i need to install a module like https://processwire.com/talk/topic/12050-module-jquery-file-upload/ I would like to build it with core functionality. What do you guys think? Can you point me into the right direction? Cheers Stephan
  3. Dear ProcessWire buddies, I am on a tight schedule and I don't have a lot of time for research, so I hope any of you already had a similar case. I have a form and form data will be saved as a new page. How would you go about implementing a nice ajax video upload (with upload progress) on frontend and then adding this video to appropriate page. Besides that, I would need a video playback in cms. For frontend, I guess the fastest would be to use some library -> what is ProcessWire using for it's ajax file upload? Is it reasonable to use this in frontend as well? I have no idea how to make a video player in cms. Probably with a custom field type, that would then render a html5 video element if video is present. Is there any documentation on creating something like that? I hope you will be able to help me, Thank you all!!
  4. Hi, i'm quite new to processwire and have been getting on very well with it. I've noticed an issue when I upload an (exported from Photoshop) PNG with alpha via the image field. The original file was only 34kb, but after uploading its now 138kb? Can anyone help me figure out whats going on? I've searched Google and the forums, but could not find an answer. This doesn't seem to happen with JPEGS. Thanks in advance!
  5. Hello, I am building a frontend form following Soma's great example on a PW 2.7.2 stable install. The pages that I edit with the form already exist. My form includes a single image field, CKEditor fields and some normal text fields. The form renders fine, all CSS and JS is in place. I can even use the pwImage plugin on the CKEditor field and it loads the image from that page. When there already is an image present in the image field and I submit the form, I get this error: Fatal error: Exception: Method Pageimage::path does not exist or is not callable in this context (in /var/www/utgpwnew/wire/core/Wire.php line 358) #0 [internal function]: Wire->___callUnknown('path', Array) #1 /var/www/utgpwnew/wire/core/Wire.php(398): call_user_func_array(Array, Array) #2 /var/www/utgpwnew/wire/core/Wire.php(333): Wire->runHooks('callUnknown', Array) #3 /var/www/utgpwnew/wire/core/Wire.php(337): Wire->__call('callUnknown', Array) #4 /var/www/utgpwnew/wire/core/Wire.php(337): Pageimage->callUnknown('path', Array) #5 /var/www/utgpwnew/wire/modules/Fieldtype/FieldtypeFile.module(119): Wire->__call('path', Array) #6 /var/www/utgpwnew/wire/modules/Fieldtype/FieldtypeFile.module(119): Pageimage->path() #7 /var/www/utgpwnew/wire/core/Wire.php(459): FieldtypeFile->hookProcessInput(Object(HookEvent)) #8 /var/www/utgpwnew/wire/core/Wire.php(333): Wire->runHooks('processInput', Array) #9 /var/www/utgpwnew/wire/core/InputfieldWrapper.php(636): Wire->__call('processInput', Array) #10 /var/www/utgpwnew/wire/core/Inp in /var/www/utgpwnew/index.php on line 248 If the image field is empty, I get this error on submit Fatal error: Call to a member function path() on a non-object in /var/www/utgpwnew/wire/modules/Fieldtype/FieldtypeFile.module on line 119 If I change the image field to hold more than one image, I don't get the error and the form submits fine with and without one or more images in the field From debugging I see that the error is triggered from $form->processInput($this->input->post); So the code does not work on single image fields. Is there a way to fix this? Any help would be much appreciated.
  6. On my dev (localhost) my gallery appears to be working just fine. It is set to "Automatic", and if I drop in 8 images all of them upload in the order I selected and all save out. However on my production server, the images upload all out of order and then it deletes 4 of them. Has anyone else had this issue or know how to solve it?
  7. Hello All, I am trying to upload multiple PDF files into one repeater field. The exact situation is, if someone submits the form. make newItem in repeater add all the PDFs in newItem. every thing is working without repeaters(files not getting replaced). But in repeater, only last file remains exist.Other PDFs getting replaced from the newItem field of repeater. My code looks like- $p2= pages->get($id); $pdfs = new WireUpload('f_plan'); $pdfs->setMaxFiles(8); $pdfs->setOverwrite(false); $pdfs->setDestinationPath($upload_path); $pdfs->setValidExtensions(array('pdf','xps')); // execute upload and check for errors $pdf_files = $pdfs->execute(); echo count($pdf_files); //count is working if(!count($pdf_files)) { $pdfs->error("Sorry, but you need to add a photo!"); return false; } foreach($pdf_files as $filename) { $p2->of(false); $new_rep = $p2->floor_plan_rep->getNew(); $p2->save(); echo $pathname = $upload_path . $filename; //all the urls are okey $new_rep->floor_plan = $pathname; $p2->save(); $p2->of(true); unlink($pathname); } Also it is making one extra blank repeater field inside repeater.(I know something is wrong and something is missing in my code. ). Please help. Thanks
  8. Hey guys, I'm really really desperate for help at this stage, for my own sanity mostly. I've been trying to set up a form that requires several fields one of which is a file upload, the user can upload max 10 files with extension jpg/png/jpeg and these are sent to the admin email as attachments. Currently this i am using the InputfieldFile module, I have moved it over to /site/modules because hooking the return html wasn't enough for my needs. So basically I have this. $images = $modules->get("InputfieldFileCustom"); $images->attr('label', "Upload your images"); $images->required = 0; $images->maxFiles = 10; $images->attr('id+images','image'); $images->attr('placeholder','no file selected'); $images->attr('extensions','jpg'); $form->append($images); I expected output that would allow me to upload and delete files. Except right now my biggest issue is the fact that the remove button isn't being displayed because the ___renderItem method isn't being run and I have no idea how to make this work. I'm going to have to do a lot of fun stuff with the markup for the majority of the render methods but I can't do anything until I get the remove button to display. I also made a inputfieldfilecustom.js which is imported on the page. I've renamed all instances of InputFieldFile to InputFIeldFileCustom (in both js and module) Begging for help around now. it would be incredibly appreciated if someone can give me any direction.
  9. When i'm uploading multiple Images in backend everything looks fine first. - All Images are uploading - All Images are shown as Thumbnails but after saving, about 50% of the images are gone. For Example: I upload 10 images, every image is shown in the form, but after saving i have just 5 or 6 images assigned. I don't get any errors, not in Developer Console, not in PW logs, no PHP Errors If i drag and drop them one after on the upload area (same files) and wait until thumbnail is shown and then save the form, everything works fine. If i try the same form local on a XAMPP installation, everything works fine. Any idea ?
  10. I know how to create pages with the API. I need help with the form itself. Here's what I'm working with so far, hacked together from examples found in this forum: <?php $upload_path = $config->uploadTmpDir; $out = ''; // create a new form field (also field wrapper) $form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'upload-form'); // create file field $field = $modules->get("InputfieldFile"); $field->label = "Audio File"; $field->attr('id+name','audio'); $field->description = "Upload your track(s)"; $field->destinationPath = $upload_path; $field->extensions = "mp3"; $field->maxFiles = 10; $field->maxFilesize = 2*1024*1024; // 5mb $field->required = 1; $form->append($field); // append the field // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Upload"); $submit->attr("id+name","submit"); $form->append($submit); // form was submitted so we process the form if($input->post->submit) { // user submitted the form, process it and check for errors $form->processInput($input->post); if($form->getErrors()) { // the form is processed and populated // but contains errors $out .= $form->render(); } else { // do with the form what you like, create and save it as page // or send emails. to get the values you can use // $email = $form->get("email")->value; // $name = $form->get("name")->value; // $pass = $form->get("pass")->value; // // to sanitize input // $name = $sanitizer->text($input->post->name); // $email = $sanitizer->email($form->get("email")->value); $out .= "<p>You submission was completed! Thanks for your time."; } } else { // render out form without processing $out .= $form->render(); } $content .= $out; That outputs the form but I can't drag & drop or input more than one file, and when I submit it says "Missing required value". I need to at least create one or more pages from the form submission, i.e., one per file uploaded. If possible I'd like to be able to set the title and description for each file/page as well.
  11. Hello, I have a problem with the GD library on the server. When I upload an image I get this error below and half grey images. When I checked the original image it seem to be half uploaded half empty and resized images are grey like in the attachments. Server is ubuntu 14.04, with php 5.5.9 and GD 2.1.1-dev installed. I already tried gd.jpeg_ignore_warning = 1 that I found on many sources. Anyone have any idea? Thanks ahead Parse Error: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: (line 330 of wire/core/ImageSizer.php) EDIT: Uninstalling GD then restarting server and reinstalling again somehow worked.
  12. Is it possible to upload zip file, unarchive it with save it structure? Thanks!
  13. Hi. I've just started using ProcessWire and the first issue I encounter is the lack of possibility to upload files to pages. I can upload images, but not files. I've tried to find an answer in the Forums, but with no success. What to do? Kind regards Hyldig
  14. Hi. i can not upload any image to pages. No error in error log. There is "Uncaught SyntaxError: Unexpected token <" error in Js. i searched all forum, but no result for my problem
  15. Hi all! My first post here, and I'm pretty new to the PW thing, even if I'm falling in love with it . Currently, I'm making a portal with PW and trying to add a few custom fields to the users' profile (image, socials, etc.). The issue here is that I'm able to add custom fields to the user profile, but PW doesn't save the values into these fields. It does let me insert the text or upload the image, but doesn't stores them into the database. And no error is printed out. By looking into the network traffic I did find that in some case it returns a JSON response: {"error":false,"message":"AJAX Page not saved (no changes)"} I've searched/googled about this particular issue but didn't find anything about it. I also have tried the solution described in this other topic (https://processwire.com/talk/topic/1002-cant-upload-imagefiles-problem/) to try in solving the image issue at least, without any good result. I thought the problem was maybe connected to the file permissions on the local installation, but the same situation has verified on remote test installation. I'm using latest stable PW version on WAMP: Apache v2.4.9 PHP v5.5.12 MySQL v5.6.17 Any idea, friends? Thanks.
  16. I have a PW site where I had been successfully uploading png and jpeg files. Recently the file and image file fields don't save. The upload status bar completes (100%) without error but when the page with the file field is saved the uploaded file name is missing from the refreshed page. This must be due to a site hosting change but I need more specific info like error details before I raise it with them. The php v5.4 config has file uploads enabled and safe mode is off. I have tried the following to fix this without success: I have read and tried the fixes to the similar posting from Soma: can't upload image/files problem Upgraded the PW site from 2.3 to 2.5.3. (no change) Turned on debug in config.php with no obvious error messages showing. Debugged core\WireUpload.php where I found that the recommended fixes from 1. wouldn't work because the file field is not using Ajax. Have you got any other suggestions?
  17. Hi! I'm new to ProcessWire and i need a "little" help with my family's website. What i want: The website of my family contains a gallery, where photos are shown in several albums. The current tree looks like this: ---photos ------ New Year 2013 ------ Going to the zoo ------ Dad's 60th birthday ------ Our Pug ------ ... Showing all pictures on one page is no problem for me, i got that working. But the photos should be Instagram-like "commentable" and "likeable". So i have to create a page for every single image, right? My questions are now: what's "the best" way to do this? Is it possible to automate this process? And how? I hope you understand, what i'm trying to do... my english is not that good, school is a few days ago... paulbrause
  18. I'm developing a site for a client which involves (non-logged in) users submitting resources which other anonymous users can then view or download. The final downloadable resources will be produced by my client from files and text (up to 10 files - pdfs, spreadsheets, images etc) uploaded by the user. So the flow goes something like this: User submits a frontend form containing a description of the resource, eg typical resource may be "Study of sustainability of commercial fishing in area X", along with a number of files, for example, shaded maps (image), spreadsheet of data, word or open document of evidence, and a number of other images. Files and text descriptions are emailed to my client Client reads through and organises the files and text into one or more PDFs. Client creates a new PW page, adds a description of resource, and uploads PDF(s) to the page Users then view the PW page and can download or view the accompanying PDFs Pretty simple kind of scenario. However, I'm conflicted as to how the upload/emailing of images should proceed; I could either: email the uploaded resources (up to 10 of) direct to the client, or use the API to create a PW page, add the uploaded resources to the page, save page, email resources from the page to the client, and then finally delete the page. Option 1 is simple, but there may be issues? - email failure would result in loss of the resources - large email (10 attachments of up to possibly 5Mb each) could be seen as spam? etc. Option 2 is a little more complex but allows resources to be maintained - in case of email failure resources could be downloaded manually I'm looking for suggestions here, which option would you choose to implement, or an alternative path altogether?
  19. How to automatically rename the image files to a random string during the upload process? For example, I have an image named "big_poster.jpg" and I want it to be saved as something random, for example "2680542675157_cc7m541v_l.jpg"
  20. Hi there I have been using soma's form-process.php to sort out uploading images and form details to create pages and it works great. However, I now want to extend it so that I can allow mixed allowed extensions like txt, csv as well as image files to be uploaded. (to allow designers etc to upload project files) - I don't however need to see the files or images, but just create a link in the created pages to let me download them from the created directory so that I can process/view them. Second part would be to get an email heads up (less of an issue), then do a drag and drop front end. Get there eventually. Any pointers or help that didn't need me to roll back too much would be great.
  21. Hi, today I installed a fresh copy of Processwire (2.4 dev) and now i wanted to upload some files and images on a page. when i select the files the ajax-upload works as expected (although there are no thumbnails). but after saving the page the input field is empty again and the files are gone from the page. in the filesystem the files are still existent. do you have any idea what could cause this problem? thanks! EDIT: when i turn on the console, I see the following error: POST http://localhost:8888/cms/page/edit/?id=1025 500 (Internal Server Error) InputfieldFile.js?v=107:252 uploadFile InputfieldFile.js?v=107:252 traverseFiles InputfieldFile.js?v=107:287 (anonymous function) InputfieldFile.js?v=107:297
  22. Hi everyone, I'm working on a project where users can upload images, using a jquery uploader (no $_FILES input in the form) : - User select images - Images are uploaded in a specific folder After that, how can i attach the images to a page ? I took a look to wireupload() but it seems to need a $_FILES input. Thanks for you help
  23. Hey guys, I am just new here and I am trying to understand how to use this tool. The app: more or less a copy of wetransfer Who's building it ? Me. as a learning project, I want to build a local file transfer app. What I want it to do? : notifications via email Single / Multiple files upload ( a maximum of 4 gb per file / or maximum of 4gb of multiple files ) How should I think the structure of this app? How would upload system work ? Please provide links and tags. Cheers
  24. Hi ! I trying to send a "Participant form" that should be a bit dynamic. Very simplified the form looks like this Club info Participant NAME etc [ + add one more ] Photo of receipt [submit] My problem is how to use wireupload with data sent by JavaScript. I get as far as the upload path... but at $u = new WireUpload(XXX); I'm totally in the dark which info the xxx should bee when sent as JavaScript. ? My goal is to populate the field $item->f_receipt with the photo. (Right now im working locally... hope that don't cause problem) var_dump($_FILES); looks like this so im sending something to my process page: array(1) { ["f_receipt"]=> array(5) { ["name"]=> string(22) "121010-111847AM_m7.jpg" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(36) "/Applications/MAMP/tmp/php/phppJGcSh" ["error"]=> int(0) ["size"]=> int(50846) }} I have been reading around at the forum for two nights but im to novice to get it. Copying code from http://processwire.com/talk/topic/1809-image-upload-via-wireupload/ http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/page-3 this is my code: All tips in the right direction will very welcome. function addPage($ordernumber, $name, $enamn, $gender, $weight, $cardnumber, $club, $trainer, $epost, $telefon, $message, $receipt,$_parent ){ $item = new Page(); // create new page object $item -> template = 'competition_form_person'; // set template $item -> parent = $_parent; $p -> name = uniqid($name . '_' . $enamn); $item -> title = $_REQUEST['f_ordernumber'] .'_' . $name . '_' . $enamn . '_' . $weight; $item -> save(); $item -> f_ordernumber = $ordernumber; $item -> f_name = $name; $item -> f_ename = $enamn; $item -> f_gender = $gender; $item -> f_weight = $weight; $item -> f_kampsportskort = $cardnumber; $item -> f_club = $club; $item -> f_trainer = $trainer; $item -> f_epost = $epost; $item -> f_telefon = $telefon; $item -> f_message = $message; $item -> save(); $upload_path = $page->config->paths->root . 'tmp_uploads/'; echo '$upload_path---------------------------->' . $upload_path; // RC: create temp path if it isn't there already if(!is_dir($upload_path)) { if(!wireMkdir($upload_path)) throw new WireException("No upload path"); } if(empty($_FILES[$req]['name'][0])){ $errors[$req] = "Select files to upload."; } // setup new wire upload $u = new WireUpload($receipt);/// $receipt['name'] $_FILES $u->setMaxFiles(1); $u->setOverwrite(false); $u->setDestinationPath($upload_path); $u->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif')); foreach($u->execute() as $filename) $item->f_receipt -> add($filename); $item -> save(); } The JS sending info oData = new FormData(document.forms.namedItem("form_competition")); var receipt = document.getElementById('f_receipt'); var file = receipt.files[0]; oData.append('f_ordernumber', postJSON.f_ordernumber); oData.append('f_trainer', postJSON.f_trainer); oData.append('f_epost', postJSON.f_epost); oData.append('f_telefon', postJSON.f_telefon); oData.append('f_receipt', file); oData.append('f_message', postJSON.f_message); oData.append('fighters', JSON.stringify(postJSON.fighters)); /*make the ajax call*/ $.ajax({ url: "/slagskeppet_test/ProcessWire-master/call_competition_form/", type: "POST", data: oData, contentType: false, processData: false, success: function(msg){ alert(msg); }, error: function() { alert("failure"); } }); /Erik
  25. Hi together! After installation i tried to install a language pack, but after dragging the file into the field i got an error with the following message: "Error writing to /tmp. Please define $config->uploadTmpDir and ensure it is writable." I tried to edit the config.php in the dir site and add the following line: $config->uploadTmpDir = dirname(__FILE__) . '/tmp'; But that is also not a solution. Does anybody know a solution for this problem? I have the problem with every kind of uploading a file. I am happy about every answer. Regards, Bluemagicon
×
×
  • Create New...