On Jan 10, 12:19 pm, The Editor <[email protected]> wrote: > On Sat, Jan 9, 2010 at 3:42 PM, Markus <[email protected]> wrote: > > Shouldn't setting the filename like this work? > > > [form] > > Name: [text name] > > Select File: [file upload] > > [box description rows=5][box] > > [submit UPLOAD] > > [session filename {=name}.ext] > > [session target {=name}] > > [session create [(source my_template)]] > > [session changesummary "Page created [(time {now} %x)]."] > > [session author {member}] > > [session savedata title,changesummary,author,description,name] > > [session nextpage {=target}] > > [form] > > > Unfortunately, the upload is named "{=name}.ext". > > In this form, you need to watch your order of operations. The reason > you are getting page {=name}.ext is because [file upload] uses that > parameter, but BoltWire doesn't do the field replacement until it gets > to that line. Switch the order and it should help. > > > One more problem with the posted form. > > > my_template contains a form. When the new page is created using the > > source of my_template, "[form]" becomes "[fo`rm]". Both for the > > opening and closing tag. > > Normally this happens when a non-editor tries to save a form, as a > security feature. If you want a way for non-editors to generate forms, > which doesn't seem wise to me, you will have to create a custom > plugin. Perhaps there's another way to accomplish your goals? > > > This filename issue is weird. Even in this stripped down form it does > > not work: > > > [form] > > [session filename {page}.png] > > [t] > > [r][c]Select File:[c][file upload] > > [r][c][c][submit UPLOAD] > > [t] > > [form] > > > I get "Form submitted. File my_fancy_pic.png failed to upload." The > > size is allowed, the type is allowed. > > That error suggests your file was uploaded but not able to be moved to > the appropriate location. > > You could try adding the first line to your system to see if anything > looks weird, commands.php, line ~624 > > print_r("$field | $filepath/$filename");die(); > if ($auth == true) $success = > move_uploaded_file($_FILES[$field]['tmp_name'], > "$filepath/$filename"); > > See if any of those variables look a bit weird. Then we can backtrack > the debugging from there.
I replied too quick. No idea why it worked once or twice. Now, it doesn't. print_r returns: upload | files/mypic.png My field is not named "upload". "files/mypic.png" is what I expected.
-- You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/boltwire?hl=en.
