I have just downloaded a .net image uploader from github, it works a treat but because it's still got all the settings it came with, each image that's being uploaded is being named the same, and as such each image is overwriting the last.
When this is live, I would like the images to be named by the title and artist of the individual item.
I don't have much experience with .net, normally with asp I would request("fieldname") and carry that across, but this doesn't work
So my question is, how do I take the value of the field "thisuser" from the form and append the "upload_original" and "upload_thumb" variables in the code above?
I tried dim thisuser as integer, and a few other things but kept getting errors as I am unfamiliar with .net.
Code below:
<SCRIPT LANGUAGE="VBScript" runat="server">
const Lx = 200 ' max width for thumbnails
const Ly = 240 ' max height for thumbnails
const upload_dir = "upload_resize_test/" ' directory to upload file
const upload_original = "sample" ' filename to save original as (suffix added by script)
const upload_thumb = "thumb" ' filename to save thumbnail as (suffix added by script)
const upload_max_size = 2000 ' max size of the upload (KB) note: this doesn't override any server upload limits
dim fileExt ' used to store the file extension (saves finding it mulitple times)
dim newWidth, newHeight as integer ' new width/height for the thumbnail
dim l2 ' temp variable used when calculating new size
dim fileFld as HTTPPostedFile ' used to grab the file upload from the form
Dim originalimg As System.Drawing.Image ' used to hold the original image
dim msg ' display results
dim upload_ok as boolean ' did the upload work ?
</script>
And the form that it comes from with the field and its value I want to append to the file name (upload_original and upload_thumb_
<form enctype="multipart/form-data" method="post" runat="server">
<table>
<tr><td>Select the file to upload:</td><td><input name="thisuser" id="thisuser" type="hidden" value="123"><input type="file" name="upload_file"></td></tr>
<tr><td colspan=2>Max upload size <%=upload_max_size%>Kb, gif/jpg/png only</td></tr>
<tr><td colspan=2><input type="submit" value="Upload"></td></tr>
</table>
</form>
Naturally there is more code but I don't think it's relevant and don't want to clog up the post!
Many thanks