I am having issues getting some code to work. It was working, but I dont know what I broke. Now it works intermittently.
this code returns this sometimes
so i know it is getting the records i need.
but then it will say this:
it creates empty files with no images inside.
Perhaps I did something wrong with the code.
Thanks for helping me out
Code:
'Date Created: 23-Jun-2010 09:22:28 AM 'Last Updated: 28-Jun-2010 11:25:16 PM 'Created By : brainchild 'Updated By : brainchild '{48ae2b14-bdfd-49b6-b168-924bb576516d}' FUNCTION image_publisher AS P (key AS C ) dim tbl as p dim file as C dim args as sql::arguments if eval_valid("arguments") then if typeof(arguments) = "P" then args = arguments end if end if tbl = table.open("images",args) tbl.query_create("N","Link_Id=\""+key+"\"","") i = 0 while .not. tbl.fetch_eof() dim container as P dim fptr as B container.name = tbl.NAME container.image = tbl.IMAGE file = A5.Get_Path()+"\Images\Items\\"+ trim(container.name)+".jpeg" if container.name <>"" then test = file.exists(file) if (test == .f.) then 'create file pointer fptr = file.create(file, FILE_RW_EXCLUSIVE) 'save blob fptr.writeb(container.image) 'close file pointer fptr.close() 'upload_address = "Items\\"+ trim(tbl.NAME)+".jpeg"+"" 'ftp_file_xfer(address,user,password,file,upload_address,"put",.f.,upload_address) end if delete container delete fptr end if tbl.fetch_next() i=i+1 end while tbl.close() ' image_publisher.count = i image_publisher.file = file END FUNCTION
Code:
?image_publisher("{48ae2b14-bdfd-49b6-b168-924bb576516d}") = count = 2 file = "C:\Users\brainchild\Documents\Databases\Austin_Cox\New folder\Images\Items\test_duplicate.jpeg"
but then it will say this:
Code:
?image_publisher("{48ae2b14-bdfd-49b6-b168-924bb576516d}") ERROR: command: fptr.writeb(container.image) Not found fptr.writeb method not found.
Perhaps I did something wrong with the code.
Thanks for helping me out
Comment