This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello guys. I've been programming in html/css for a bit now, but I'm fairly inexperienced with any other sorts of code. I've dabbled a bit, and I'm just now starting to try and get into JS/JQuery, PHP, etc.
I am basically, currently, working on a good method to where you could use a html form to select and upload an image or video, but instead of it uploading to a database, have the file get saved directly to the server, with the rest of the website files/folders.
I've spent some time trying to find solutions to this on the interwebs, with little to no avail--most of them just hand you some code, have you paste it, and it just flat out doesn't work. Or it does, but with no explanation on if there are any fields that should be changed, etc.
By the way, I am mostly doing this for my own educational purposes, as of right now none of this is really going to be used for anything publicly.
My main question is: What is a simple method to do this, and is PHP/JS required? Or are there <form> attributes I can use to do something like this?
The code I have is as follows:
`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script> <!-- Reference to JQuery -->
</head>
<body>
<div class="img-upld">
<form>
<label for="Upload-Images-Test">Upload Images Test</label><br>
<input type="file" name="uploadImg" accept="/images/\*" action="/images/"><br>
<input type="submit" value="Submit"><br>
</form>
</div>
</body>
</html>`
Subreddit
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/CodingHelp/...