Indy FTP - Navigating to a certain folder from current folder - delphi

You never upload files in the root of an FTP folder. You always have a 'base' or 'remote' folder in which you work. In most cases this is 'public_html/domain.com'.
How to navigate to a specific folder from a random current folder without navigating all the way down to FTP root? Some kind of FTP.NavigateTo('downloads') which will always start the navigation from 'base' folder no matter where you are now.
I am asking this because navigating through few folders takes more time that uploading a HTML file!
What would be the most efficient way (navigation through as few folders as possible) of navigating?

You never upload files in the root of an FTP folder. You always have a 'base' or 'remote' folder in which you work. In most cases this is 'public_html/domain.com'.
That is entirely dependent on the server's particular configuration. I've connected to (and written) FTP servers where the "root" folder is mapped to the logged in user's home directory on the server's filesystem, and thus uploading directly to the "root" is perfectly acceptable.
How to navigate to a specific folder from a random current folder without navigating all the way down to FTP root?
Simply provide an absolute path (relative to root) to TIdFTP.ChangeDir(). FTP allows both absolute and relative navigations.
Some kind of FTP.NavigateTo('downloads') which will always start the navigation from 'base' folder no matter where you are now.
FTP.ChangeDir('/downloads');

Related

Hyperlink to a file in the current folder regardless of its location on the drive

Putting together a .doc file with a table of content with links to external files. The challenge is: how to make them so that it points to the given file in the current folder regardless of its location on the disk.
Context: I will be sending the set of files to another person, so I can't put the path on my machine, nor on a server since they will be working offline. They will be working on Remarkable device and I want them to be able to use the major overview file with the links to access each of the files, rather than having to browse the folders.

having external files in an electron application

I have an electron app, and when I make it, it packages and compiles everything.
Sounds like it works perfectly right?
Well, problem is I want one of the folders to not be compiled, but still be accessible by my static files, so the users can add or remove content from the folders.
I've tried making it in a seperate folder, but then it can't find the files even when it's placed in the correct relative path.
Overall, I want my app to exist next to a folder and my <script src="./folder/script.js"></script> to actually be able to access it.
I'm new to basically anything node or electron so i'm probably making some dumb mistake.
Thanks in advance.
Having your user touching files close to your Electron application may be fraught with danger. If they accidently overwrite an important file or accidently delete an important file then your application may stop working and require the user to perform a re-install.
Instead, have any default files the user may need to "touch" packaged up with your application and then upon your applications first run, copy these files (and any necessary folder structure) over to the users home, desktop, documents, downloads or even userData directory.
That way, your application will always know where to find them and the directory is a directory your user will already be comfortable adding files to and removing files from.
You can always let the use choose where these files are stored as a settings option which persists in an application setting file, using something similar to path.join(app.getPath('userData'), 'settings.json');
See Electron's app.getPath(name) for more information.

Changing output directory in MVC Application

I am having a problem with my MVC application after I set a different output folder instead of the default Bin folder . I also deleted the bin folder .
This resulted in Global.asax file exception "Cannot load the type Global.Mvc application" during application runtime.
I am trying to get rid of all the bin folders to have just one output folder for my application . I would like to know if it is possible at all to get rid of the bin folder completely . Am I missing some setting here or is it a must to have bin folder ?
I find a way to change bin folder.
Just like you say, When we change the default output folder:"bin\", then it will display some exception, Maybe that's a bug from visual studio.
Actually a lot people want to change the default bin folder to some RAM disk position, then it will save HDD life(don't let the HDD always write again and again), also very fast for read and write.
We can't change the default address, but we can change it use this way(delete bin folder before):
Open CMD.exe(administrator mode), put this code and execute:
mklink /d "Your project folder\bin" "new address(like RAM disk address)\bin"
mlink can redirect the original folder position to new position. Then, all fine such like you need.

Searching up from a root directory when using SelectDirectory in delphi

I am using the SelectDirectory function in delphi in order to select a folder. I set the root to a default directory where the items a user is looking for should be. However if I want to be able navigate "above" where I am then I am unable to.
For example:
Lets say the default folder is C:\Program files\Default folder and when I am in there I can view all folders and select the one I want. However if I want to return to program file to look for another folder then I do not know how I do that.
Also I had considered using TOpenDialog but I found I wan unable to select a folder and see the files that are present in the folder (a setting which is important in SelectDirectory).
Is there a way to navigate above the root folder or possibly open the window cascaded down to the folder, as in it will display as though someone has navigated from computer to the root folder already?
Code:
SelectDirectory('Please select a directory', RootSearchLocation, ChosenDirectory,
[sdShowEdit, sdNewUI, sdShowFiles, sdValidateDir], self);
Where RootSearchLocation is C:\Program files\Default folder and ChosenDirectory is the directory the user chooses.
Any more information needed let me know.
It is not possible to navigate upwards from the specified 'root' folder in the browse for folder dialog. But you can specify an empty 'root', and fill in the 'directory' parameter with the directory you want the dialog to initially navigate.

why have most of the files in a dreamweaver site been put into a directory called 'upload'?

I cleaned up someone's style sheet for a Dreamweaver site, by editing the css directly, and now the secretary is having trouble using her old template.
Most of the files in her site reside in subdirectories of the 'upload' directory. For example, I would have expected to see the stylesheet in
../assets/css/ etc.
but in fact I'm finding it in
../upload/assets/css/ etc.
In addition to assets, I am also finding Templates and images as subdirectories of 'upload'.
Do you know why this 'upload' directory was used?
I am considering two possible approaches.
(1) Make sure everything needed is in ../upload/ and remove the subdirectories that are directly in the root directory
(2) Edit the template to remove all references to ../upload/
Note that (2) appeals to me because the file structure will be simpler; but I wonder if the client has some sort of extension in her Dreamweaver that causes everything she ftp's to be put into the 'upload' directory.
Note that so far I have copied my cleaned up css file over to ../upload/assets/ as a short-term solution. But they want to be able to make changes to their template, and add new pages, on their own in future.
Thanks.
The likely problem is how she has her FTP remote settings specified. It appears that it now points to the upload folder rather than the web root. Or, it could be that her FTP user account is tied to the upload folder rather than the web root.

Resources