eliteel5
Member
- Messages
- 40
- Reaction score
- 1
- Points
- 8
I dont quite know how this has happened but could you check for me as to what the status of this is and keep an eye on this please
Might be an idea to pick up on IP / Mac address
Attached is photo This may well have been someone using code I will change pass word for FTP in the meantime
Thanking you Mark
Pages affected using code to operate live webcam and upload images is as follows
Using python for webcam code is as follows ~
HTML Code uploaded to server
CSS Code for this
Might be an idea to pick up on IP / Mac address
Attached is photo This may well have been someone using code I will change pass word for FTP in the meantime
Thanking you Mark
Pages affected using code to operate live webcam and upload images is as follows
Using python for webcam code is as follows ~
Python:
import cv2
import ftplib
import sched, time
from datetime import datetime
# this is the function that will be called on starting thread
def saveImage(s):
print(s)
ret,frame = vid.read()
vid.release() #releasing camera immediately after capturing picture
now = datetime.now() # current date and time
date_time = now.strftime("%d/%m/%Y, %H:%M:%S")
font = cv2.FONT_HERSHEY_COMPLEX
# Use putText() method for
# inserting text on video
cv2.putText(frame,
date_time,
(10, 40),
font, 1,
(255,255, 255),
1,
cv2.LINE_4)
cv2.imwrite('img.jpg', frame)
def uploadtoFTPServer():
# Fill Required Information
HOSTNAME = "x12.x10hosting.com"
USERNAME = ""
PASSWORD = ""
filename = "img.jpg"
ftp_server = ftplib.FTP(HOSTNAME, USERNAME, PASSWORD)
# force UTF-8 encoding
ftp_server.encoding = "utf-8"
ftp_server.cwd("/domains/eliteprojects.x10host.com/public_html")
with open(filename, "rb") as file:
# data = []
#ftp_server.dir(data.append)
#for line in data:
#print ( "-", line)
# Command for Uploading the file "STOR filename"
ftp_server.storbinary(f"STOR {filename}", file)
time.sleep(2)
ftp_server.quit()
# main execution starts here
while(True):
vid = cv2.VideoCapture(0)
vid.set(3, 640)
vid.set(4, 480)
time_now = time.time()
saveImage(time_now)
time.sleep(1)
uploadtoFTPServer()
HTML Code uploaded to server
HTML:
<head>
<link rel="stylesheet" href="timerpage.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script>
$( document ).ready(function() {
setInterval(function () {
var d = new Date();
$("#myimg").attr("src", "img.jpg?"+d.getTime());
}, 1000);
});
</script>
</head>
<body>
<div class = "container " id = "container">
<img class="switch" id ="myimg" src="img.jpg" />
</div>
</body>
CSS Code for this
CSS:
* { margin-top: 40px;
padding: 0;
list-style: none;
text-align:center
}
body{
background-color: black;
}
.container{
padding:20px;
width:640px ;
margin:0 auto ;
border-style: solid ;
border-width: 1 ;
border-color:#ffffff;
border-radius: 10px ;
}