Search the Community
Showing results for tags 'destinationPath'.
-
Hello, I basically misclicked my htaccess folder into being synced with my Drive (don't ask me how). While the local site I was working on under htaccess still functions, I cannot edit anything anymore in PW without getting "destinationPath is not writable" on save. While the folder is now back to being completely unsync'd with Drive, the issue still persists and it seems it has permantently messed something up in the PW install. Thankfully I'm in no rush and would like to take this as a learning opportunity. I'm still mainly a designer and still not so familiar with many things backend-related. Feel free to ask me anything more you'd need to know.
-
Hey all, I've looked at some other threads and github issues, but didn't find what I was looking for: https://processwire.com/talk/topic/21616-file-upload-inside-custom-module/ https://processwire.com/talk/topic/619-what-does-it-mean-destinationpath-is-empty-or-does-not-exist-upload_file/ https://github.com/processwire/processwire-issues/issues/885 I'm on PW version 3.0.165. I have a module using InputfieldFile to upload a CSV, then move it to a unique filename within a subdirectory in the module. Then it processes the CSV into a db table. That's actually all working smoothly, except I still get error messages on upload "destinationPath is empty or does not exist [field label]" and "Missing required value [field name]" Below is the relevant code. A couple notes: 1. I have both `required` and `requiredAttr` set because I wanted to avoid them clicking submit without selecting a file (it's happened, haha). I've tried turning those off and it fixes the second error "Missing required value" but not the first one about destinationPath 2. I can't seem to debug the $destination created by tempDir(), because I think it is removed when the request ends, but I presume it must be working OK because the CSV file ends up in the `/.uploads/` directory I specify, and is processed into a database table. 3. `/site/assets/cache/` directory is chmod 0777 and owned by "nobody" (yes, I know, I need to tighten this down :) Thanks for any assistance! Worst case I guess I can tell them to ignore the red message since it is actually working. <?php $destination = $this->files->tempDir($this)->get(); // debugging shows $destination = /site/assets/cache/WireTempDir/.ProcessMemberScorecard/0/ $form = $this->modules->get('InputfieldForm'); $form->attr('action', $this->page->url . 'upload-scores'); $form->attr('enctype', 'multipart/form-data'); $wrapper = new InputfieldWrapper(); $wrapper->importArray( [ [ 'type' => 'file', 'name' => 'scores_upload', 'label' => 'Scores File', 'description' => 'Select a CSV file to upload', 'required' => true, 'requiredAttr' => true, 'icon' => 'upload', 'extensions' => 'csv', 'destinationPath' => $destination, 'maxFiles' => 1, 'maxFilesize' => 10 * 1024 * 1024, 'noAjax' => true, 'descrptionRows' => 0, ], // additional checkbox fields, not relevant ] ); $form->append($wrapper); if ($this->input->requestMethod('POST')) { $form->processInput($this->input->post); $ul = new WireUpload('scores_upload'); $ul->setValidExtensions(['csv']); $ul->setMaxFiles(1); $ul->setOverwrite(true); $ul->setDestinationPath($this->config->paths($this) . '.uploads/'); $dt = new DateTime(); $tmpname = bin2hex(random_bytes(8)); $ul->setTargetFilename( sprintf('%s-%s.csv', $dt->format('Y-m-d'), $tmpname ) ); $results = $ul->execute(); if ($errors = $ul->getErrors()) { foreach ($errors as $error) { $this->error($error); } return $form->render(); } if (!$results) { // older, probably not needed since both required and requiredAttr are set $this->error('Please select a CSV file to upload'); return $form->render(); } // handle processing at this point, // then redirect to the next step where user confirms // the final result } .
-
- inputfieldfile
- destinationpath
-
(and 2 more)
Tagged with:
-
It is probably something quite easy to solve, but I can't figure where. I have begun a simple site. Each page has some screen captures inserted in the body field. On my local machine, everything is fine (http://localhost). I uploaded the entire site, migrated the database, the site resides under a two levels deep directory: http://adomain.com/sites/manuel Every image has an alleged broken link, the source reads like this <img src="/site/assets/files/1011/goog.... The images field is correct, in edit mode, but still no correct display. Editing the image show it correctly! Saving gives this error: But the page now looks perfect because the linked has been correctly written: <img src="/sites/manuel/site/assets/files/1011/goog.... I have tried rewriting the base in htaccess in this fashion, but to no avail. RewriteBase /sites/manuel/ The root site is made with Drupal. This minisite, inside the directories, is for a technical manual. How do I solve this? Thank you in advance.
-
I freshly installed Processwire and now I'm trying to build a multilingual website. After uploading a language package and saving I receive the following message: destinationPath is empty or does not exist (language_files) I already configured a uploadTmpDir in my site config.php with no change. Which directory do I have to create or change permissions for?
- 5 replies
-
- language packs
- destinationPath
-
(and 1 more)
Tagged with: