this is how I'm going to do so that you have written or add a file before it will be uploaded. like here;
<script type="text/javascript">
function check(){
var elm = document.getElementById("hello-world");
if (elm.value.length>0){
alert("Hey");
return true;
}
else{
alert("Nooooo!");
return false;
}
}
</script>
So I really would like me to get done that's how nearly it together, just like the check on up on whether there is anything in the file / to upload an image. but if it is such that there is no picture but just click upload without any image at all.
This is what my html out for when you want to upload to the gallery in the database, or what I call it here.
<div class="opslag-indhold">
<form name="opslag" method="post" action="#">
<input type="file" name="file">
<input type="submit" name="opslag" value="Upload" id="del" onclick="return check()">
</form>
</div>
so would like to have built some javascript on so that there will check up on whether you have upload a file or not.
If you mean detecting when a file is uploaded, it sounds like you are looking for a validation or notify solution. First of all, code some try/catch or other condition to catch if the upload fails. Then, you need to know where the upload will land (preferably in a special folder dedicated for this purpose) and then detect when a file arrives there. Perhaps you could code a Javascript onChange
event that would send you a message. A little hard to be specific, but that's the direction you want to go.
By the way, your form tag will need: enctype = "multipart/form-data"
if you want an HTML Browse button.