NppFTP - upload failed (using SFTP) - sftp

Using FTP, everything is ok... but..
When i use SFTP, it successfully connects, and even, when i use "UPLOAD BUTTON", it successfully uploads file...
but when i edit+save file, and it starts to upload changes automatically, it cant upload (red message: file........... upload failed)..

Check to ensure that the specific file you are trying to upload has the correct permissions. The user should be able to write.

The file you are trying to upload should have read and write permission for the user you are using and also check that the owner name & owner group for the file are correct.
I faced this issue and the problem was the user which i was using was not in the owner group for which the file permissions were given.

You should have set correct External Path.
when using SFTP, external directory should start with: /home/user/MY_SITE
(unlike FTP: /MY_SITE)

Related

ASP.Net web application cannot read a file within folder

In my asp.net web application, I read the xml file for obtaining a key. If file is not present I show a form to enter the key details and then create the file.
First problem: My app does not recognize the file even if its there.
Second problem: I am running application on the server. When writing, rather overwriting the file, browser shows the username, password prompt before writing the file. If I enter admin credentials it allows to create a file.
I have checked all possible combinations of permissions on the file / folders, but could not resolve the problem.
Any ideas, what I could be missing here?
You read the xml file but is it as a part of your solution? If yes, are you reading it through relative path i.e. are you using Server.MapPath to read it like Server.MapPath("~/Files.test.xml")? Once you use relative path, I don't think it will ask you credentials as it still is in your project directory.
It should work. I am also reading and writing files in my web application.
If it still does not work, please tell me the way you are reading file.
Thanks,

Change file permissions from code behind

I wonder if its possible to change permission on file from code behind?
PROBLEM: Unfortunately i use AjaxFileupload to upload files to webserver. So far so good. The problem arises when the uploaded files, that are saved on a mapped folder on the webserver are to be opened. The files doesnt show up in folder (on other server), lack of permissions.
Here is why: AjaxFileUpload save the file in a temp folder first, then move it to actual by me defined path. The file inherit the permission from that temp folder, not the permission i have put on my mapped folder. I need to use the mapped folder and I need the permissions on the mapped folder to be inherited to the file.
Why do i need this? I need this because there is an desktop application that need to open the files. The mapped folder have all the correct permissions for doing this. So, how to do? It would be easy if i can change permission on files from code behind, lets say just after i saved the file to folder, BUT is that even possible?
I read somewhere that it wasnt a good idea to change permission on the temp folder, any ideas why?
Any help would be appriciated!
edit:
So to clearify, i dont have any problems saving file to disk (server 3). My problem is that i cant see or access files on server 1, because the file doesn't inherit the mapped folder permissons. The mapped folder have permisson from both server 1 and server 3 but one the file get uploaded the file only have permission from server 3.
I don’t think the problem is with the permission on the source file. I believe the problem is the account used to run IIS does not have permission to access the mapped folder.
You can use Impersonation to grant access for the section of code that saves the file.
See these:
WindowsIdentity.Impersonate
This question
And this question
Solved it by myself. Basically wrote some code that gave me the name of the tempfolder on webserver where ajaxfileupload made the temp-save before moving the file to the folder i wanted it. When i had the name on that folder i basically changed permission on that folder. I only gave read and list permission on the folder because i dont want the desktop application to have any other right on the webserver. That was all i needed to get the file listed on in the mapped driver.

drupal 7 error when uploading with new field

I've got a very strange problem using drupal 7. I've got a wbesite running and using views and content types I have been able to build a lot of functionality. Now the following occurs:
When I add a new field to a content type (new or existing) of the the type file or image, I have this field in the form but when I try to upload a file or image using this form it gives an error "The file could not be uploaded" or the full error (from the recent log messages): "The upload directory public:// for the file field field_katapult_voorpagina could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled."
Strangely, when I upload a file or image using an older existing field (pointing to the same directory: public://) it does not give an error and the files upload without a problem. So this makes me think that the server settings are actually set properly.
Anybody who can help me with this problem?
If not, can anybody point me in the right direction as to where I can find the files that handle the upload process in drupal 7?
Many thanks in advance!
You need to check a couple of things :
where is your public files folder, and if that is writable by the webserver ( in /admin/config/media/file-system )
where does your working field send files (it might be a different directory), and if it is, use that for the new fields as well.
Check you file destination directory setting of new image field. Do not include preceding or trailing slashes. This field supports tokens.
You can also check max, min resolutions, file upload limit, image style (if it is new image style other than thumbnail/ or existing) & number of values ( if it set to 1 you can't upload 2 or more). Finally you have to set it public files type.
I think you should check the files folder permission.

Downloading file using webclient results in "Access to the path denied is denied"

i have button, on a click of which i want to download the file on the local pc, i am using webclient.downloadfile(), but i am getting the below error:
Access to the path 'C:\Windows\SysWOW64\inetsrv\ms-banner.gif' is denied.
i am using below code to download file:
WebClient client = new WebClient();
client.DownloadFile(new Uri("http://www.contoso.com/library/homepage/images/ms-banner.gif"), "ms-banner.gif");
i dont understand why its fetching the file from local server, as i have already stated the remote uri
It's fetching the file from the remote server but trying to save it in the current directory because you have only specified a relative filename as second argument: "ms-banner.gif". And it seems that the account you are running your application under doesn't have permission to write to the current working directory which happens to be C:\Windows\SysWOW64\inetsrv.
So you have basically 2 possibilities:
Modify the account you are running your application under and grant it permissions to write to this directory
Specify another location (as an absolute path) to save the file to where the account you are running your application under has write permissions.
contoso.com redirects to microsoft.com... the path you have there in the URL does not exist and you won't be able to download it. I'm not sure why it's trying to go to your local machine, but have you tried some other image on some other website? Like http://i.cdn.turner.com/cnn/.e/img/3.0/global/header/hdr-main.gif for example?

Prevent users from deleting files uploaded Alfresco

I've been testing Alfresco for a few days but seem not to find a solution for this.
In Alfresco when an user uploads a file to a folder where it has the contributor role everything works nice, but he can delete that file. I want avoid that so I have defined a rule that takes the ownership of every file uploaded. The script is defined as
document.setOwner('admin');
This way the file can be deleted only by admin. If the rule is active the upload fails for everyother user. Does anybody know what it takes to take ownership of a file in that situation using a script?
I am using Alfresco 4.0a
Thanks.
I guess you can better do the following
document.setOwner("");
Because admin already has full authority in Alfresco.

Resources