![]() System.IO.File.Delete(fileInf.ToString()) Ĭonsole.WriteLine(ex.Message, "Upload Error") DataAccess.UpdateImageDB(item.ProductID, item.ImgFolder + "/" + item.IMG) //Update the database with the new image location and delete the img from the uploadedimages folder Write Content from the file stream to the FTP Upload Stream Read from the file stream 2kb at a time till Stream content endsĬontentLen = fs.Read(buff, 0, buffLength) Using (Stream strm = reqFTP.GetRequestStream()) Stream to which the file to be upload is written Using (FileStream fs = fileInf.OpenRead()) Notify the server about the size of the uploaded file ReqFTP.Credentials = new NetworkCredential(ftpUsername, ftpPassword) ReqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)) Create FtpWebRequest object from the Uri provided I am pretty desperate! I don't even know where to google! string ftpPassword = () įileInfo fileInf = new FileInfo(FileToUpload) I am not able to upload the folder to the root either. I then tried getting the directory listing which I am able to. Is there a different way that I have to do the upload folders? I thought that it was a write permissions issue, but I can manually login and upload a folder to the proper place. I checked the uri (I copied it from the debugging) and it went there just fine. Here I am trying to upload a whole folder. ![]() This code works fine when I am trying to upload one image at a time. ![]() Each time I try, I get an error The remote server returned an error: (550) File unavailable I need to have it in a compressed folder called by a specific name and then upload that folder to a specific directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |