davelt99 Member Licensed User Longtime User Jan 5, 2012 #1 I'm trying to upload a jpg image from phone to website. The process seems to be working, although it never gets to FTP_uploadcompleted. The file shows up in the proper place on the server, listed with the correct file name and file size but when opening it I get an Invalid Image method. When looking at the properties of the image - there are no dimensions given. I originally thought that it was due to the 1.5mb size of the jpg but am still having the problem when uploading a 20kb jpg image. These are my first attempts using the FTP within B4A. Any help would be greatly appreciated. Thank you, Dave Tucker
I'm trying to upload a jpg image from phone to website. The process seems to be working, although it never gets to FTP_uploadcompleted. The file shows up in the proper place on the server, listed with the correct file name and file size but when opening it I get an Invalid Image method. When looking at the properties of the image - there are no dimensions given. I originally thought that it was due to the 1.5mb size of the jpg but am still having the problem when uploading a 20kb jpg image. These are my first attempts using the FTP within B4A. Any help would be greatly appreciated. Thank you, Dave Tucker
thedesolatesoul Expert Licensed User Longtime User Jan 5, 2012 #2 We will have to look at the code. It seems the transfer is starting but not completing. Are you using Ascii mode? What is the FTP server platform? Upvote 0
We will have to look at the code. It seems the transfer is starting but not completing. Are you using Ascii mode? What is the FTP server platform?
davelt99 Member Licensed User Longtime User Jan 5, 2012 #3 A portion of the relevant code is below. Not sure what is meant by ASCII mode but the server platform is Windows Server 2007 with IIS 6. dim sFTP as FTP dim sMediaPath as string dim sMediaFile as string sMediaPath=fd.Filepath '''' from FileDialog sMediaFile=fd.ChosenName '''' from FileDialog sFTP.Initialize("FTP", myFTPIPaddress, 21, userID, password) sFTP.UploadFile(sMediaPath, sMediaFile, True, "/inetpub/wwwroot/Accountabillity/visuals/" & sMediaFile) Upvote 0
A portion of the relevant code is below. Not sure what is meant by ASCII mode but the server platform is Windows Server 2007 with IIS 6. dim sFTP as FTP dim sMediaPath as string dim sMediaFile as string sMediaPath=fd.Filepath '''' from FileDialog sMediaFile=fd.ChosenName '''' from FileDialog sFTP.Initialize("FTP", myFTPIPaddress, 21, userID, password) sFTP.UploadFile(sMediaPath, sMediaFile, True, "/inetpub/wwwroot/Accountabillity/visuals/" & sMediaFile)
thedesolatesoul Expert Licensed User Longtime User Jan 5, 2012 #4 I would suggest: Code: Copy sFTP.UploadFile(sMediaPath, sMediaFile, False, "/inetpub/wwwroot/Accountabillity/visuals/" & sMediaFile) But also have a look at this thread: http://www.b4x.com/forum/additional...-new-net-library-android-ftp-smtp-pop3-3.html especially the last 3 posts Upvote 0
I would suggest: Code: Copy sFTP.UploadFile(sMediaPath, sMediaFile, False, "/inetpub/wwwroot/Accountabillity/visuals/" & sMediaFile) But also have a look at this thread: http://www.b4x.com/forum/additional...-new-net-library-android-ftp-smtp-pop3-3.html especially the last 3 posts
davelt99 Member Licensed User Longtime User Jan 5, 2012 #5 Thanks, I'll try the "True" option. Upvote 0
davelt99 Member Licensed User Longtime User Jan 5, 2012 #6 Thanks so much, the suggestion to change to ascii from binary was the correct answer. Upvote 0