Solved

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

Posted on 2013-01-15
2
447 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 79

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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

776 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