SMF Support > SMF 1.1.x Support

attachment lost in preview

<< < (3/4) > >>

Curbow 5:
@Anguz
i was thinking along the lines of just uploading the files the normal way for preview, with an option to remove (i like the word detach :)) them again. that way smf doesn't have to go through the hassle of moving the files from /temp to /attachments etc.

most people wan't make a mistake in which file to upload anyway, so there's no real need for  a /temp

@Sparkiegeek
i don't think so, security's pretty right, the only thing i came up with that's even close was a 'fake' file filed (a text field and a submit button) where onclicking the button, you'd get send to a hidden file field of which the value was then transferred to the textfield..... it was just cosmetic and it wasn't even crossbrowser compatible.....  >:( :'(

Anguz:

--- Quote from: SparkieGeek on January 22, 2004, 07:40:26 PM ---Could you not use JavaScript in an onload() to write to the attachment field?

--- End quote ---
I don't know JS to answer that :P

but I like the idea of just uploading normally better,  because it'd let you see the attachments in the preview too :)

SparkieGeek:
Yeah like I said in my edit, it was a stupid idea. The security model can't be that flawed, if you could do that and were feeling malicious then you'd be able to hide the field and have JS upload a file of your choice on any form submission <-- bad, very bad

Curbow 5:
for your amusement, IE only i think:


--- Code: ---<form name="uploadform" method="post" action="" enctype="multipart/form-data">
  <input name="filename" type="text" value="" size="32">
  <input name="browse" type="button" onClick="document.uploadform.realfile.click(); document.uploadform.filename.value = document.uploadform.realfile.value;" value="Browse...">
  <input name="submit" type="submit" value="Upload" />
  <input name="realfile" type="file" style="display:none;" size="0">
</form>

--- End code ---

[Unknown]:
What happens if you click away, though? (and don't post after all.)  That's why it currently doesn't just upload.

Try it now.  It warns you.. (Simple Machines theme only.)

-[Unknown]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version