Solved

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

Posted on 2013-01-15
2
445 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 78

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now