Error “Could not write file wpid-m (Invalid file type)
-
Hi,
I’m trying to write some AppleScript to upload images that I have resized. I do this so the images register in the Media Manager rather than FTP where it doesn’t.
I am receiving this error message but I don’t understand why I am receiving it.
” xmlrpc.php got an error: Could not write file wpid-m (Invalid file type) (525768928)”
Any suggestions would be appreciated. I have included the code here in case there are any AppleScript folk out there who may have done this before. Have actually implemented an Automator workflow with AppleScript actions inside.
1. Get Specified Finder Items (point to specific file)
2. Run AppleScript:
on run {input, parameters} set thePath to quoted form of POSIX path of input set theScript to "openssl base64 < " & thePath return do shell script theScript end run
3. Run AppleScript:
on run {input, parameters} set myUsername to "myusername" set myPassword to "mypassword" set theFileName to "imagename.jpg" set theFilePath to "Mac HD:Users:myusername:Desktop:imagename.jpg" tell application "Image Events" launch set this_image to open theFilePath set theType to file type of this_image close this_image end tell set fileType to theType set overwrite to true display dialog theFileName & " " & fileType & " " & overwrite & " base64=" & input tell application "https://mywordpresssite.com/xmlrpc.php" set returnValue to call xmlrpc {method name:"wp.uploadFile", parameters:{1, myUsername, myPassword, theFileName, fileType, input, overwrite}} end tell return returnValue end run
The parameters end up being as follows:
theFilename = “imagename.jpg”
fileType = “JPEG”
input = base64 encoded image
overwrite = true
- The topic ‘Error “Could not write file wpid-m (Invalid file type)’ is closed to new replies.