I'm trying to use a script that would automate deletion of images from a website using FTP and Python. My script is as follows:
import ftplib
session = ftplib.FTP('#server','#user','#pw')
session.delete("#path_to_file_on_webserver")
This is generating the following error: error_perm: 550 Could not delete "#file_to_path_on_webserver": No such file or directory.
The path to the file is definitely correct and copying that to the browser takes me to the image. I should add that I'm using what I believe to be the full path - "http://websitename.com/pathstoimage/image.jpg"
I spoke to my webhost who changed permissions to the image folder to 777 and to the files as 777 but I'm still getting that error. What's stranger is that I can modify the script to upload images to the server and that works okay, so I'm at a bit of a loss as to what's gone wrong. Any suggestions please?
Thanks