Solved

VB - Download temp file, edit temp file, upload edited temp file - read file

Posted on 2013-01-15
2
448 Views
Last Modified: 2013-01-15
I have a small VB program that downloads a file from an FTP, then it edits it, then it uploads it back - and then it reads the new file in and does some stuff.

What I'm trying to figure out is where to "Save" the file when downloading it from the FTP.

Every PC likes to save files in different places - where is a safe place to save it every time?  Or should I just make the user choose the directory?

I was trying to do the "C:\" dir but on Windows 7 it says "Access denied"

Ideally I'd like to just read in the file from the FTP...and then write over the old one and save it over the file in the FTP - but I'm not sure how to make that all happen on the FTP with streamreader/streamwriter

All edits are done automatically by the program after it reads in the file - so once the user chooses the file on the FTP to "edit" it I would like it all done in the background without any saving as/etc junk for the user to have to bother with.

I have a feeling I'm over thinking this - any advice on how to do this quicker/faster/smarter let me know
0
Comment
Question by:ProdigyOne2k
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 38779964
You can save in current directory, in documents folder, in temp files folder etc

http://dotnetref.blogspot.co.uk/2008/03/find-temp-directory-and-getting.html
0
 
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 38780390
%temp% is the preferred location, perhaps after your upload is successful you could delete the file.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question