Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-01-15
2
Medium Priority
?
455 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 2000 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 84

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

963 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