Mail sending error from the IIS and Shared Server in asp.net - asp.net

Im doing a project where i have to send a link to my user/clients. The mail will be sent to them once they register their account. Now there will be a link in their mail when clicked on that link the users will be redirected once again to my website and they will be shown a pdf.
When i did this from my system and localserver it worked fine.
But now my project has been put up in the development server from where its not possible for me to send mail.
I get the following errors
Message: Sys.WebForms.PageRequestManagerServerErrorException: AspPDF.NET 2.0.0.14045 has generated error #46: [ Opening output file failed: Access to the path 'C:\inetpub\wwwroot\Myesign\UploadedFiles\Signed\Support2(1).pdf' is denied. ]
Im not clear that what might be the possible reason for this error. The same project worked when i used the localserver and from my pc also worked fine but from the production server the same project is not working.
Also the link that i get in my mail id is
"http://localhost/ScriptResource.axd?d=n3csX8loR-nh3aSKQ4FNi7Vth7ZBerv1fa-7sJrneEaqqdsyYs5M1zxZ6mXbdwJ0oPXtyofmMkG8z9SZaK8qgo6xYZPs72x4Icy0pXeiYtTxb_JCbdFLZmwvpEToNB0tY6mtEQ2&t=2939b118"
in the above link dont need the "http://localhost/" is there anything i can do about. Im sure there might be some way but im not able to find it.

Can you post the code you use to generate and send the link via email? It may be a relative linking issue. Also, make sure the NTAUTHORITY\NETWORKSERVICE account has permission to read files in the PDF folder on the server, as that is the account used when a file is accessed on the server through IIS.

Related

File Upload fails during recording

I have one ASP.Net application, it has upload functionality.
On click of Upload a windows application get installed/opened and it has upload feature.
When i run normally it works fine but when i set proxy on browser for Jmeter application recording works fine but as soon as i click on this Upload Utility(Windows application) it gives me error as "Application download did not succeed, Check your network connection or contact the administrator".
I am using Jmeter and trying to record the upload scenario.
How this can be resolved ?
Build it manually. Create a post Request and ensure the following
Copy uploading file to JMeter's "bin" folder
Don't forget to tick Use multipart/form-data for HTTP POST box
Make sure you provide correct Parameter name and MIME Type
Provide parameters.(if any)
Problem was with Jmeter certificate. After installing the certificate also it was giving me same error after i added certficate as trusted on my computer it worked.
After this also i faced issue while uploading and in order to resolve this i followed below thing..
Copy uploading file to JMeter's "bin" folder

"You do not have permission to view this directory or page" when trying to upload a file

I have an ASP.NET project based on WebForms that was initially published on Azure server. Just recently I have made the website point to a different custom domain and since then I'm getting this error whenever I try to upload a file. I don't have this issue on my local server though. I'm using a jQuery library "pupload" to publish files. Just soon as I click the "select files" button, I'm redirected to a page where this error is displayed.
This issue wasn't there before so I figured this might me after I changed the domain. Can someone help me out with this.
You can use FileZilla to change permission for a folder/directory in azure.
Download your publish profile from portal and connect thru FTP(set the connection in filezilla) and set the permissions.

msdeploy getting ERROR_CERTIFICATE_VALIDATION_FAILED, allowUntrusted being ignored

I am using msdeploy to push out website code to 4 different servers (test and production servers). Works fine on the first 3, but the 4th is giving me an ERROR_CERTIFICATE_VALIDATION_FAILED error. I am using the -allowUntrusted option.
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:iisApp="E:\workspace\testDeploy\outproject\_PublishedWebsites\<webfolder>" -dest:iisApp="mycompany.com",ComputerName="https://<hostip>:8172/MsDeploy.axd",UserName="<userid>",Password="****",AuthType="Basic" -allowUntrusted -enableRule:AppOffline -skip:objectName=filePath,absolutePath="^.*<webfolder>\\web.*\.config$|^.*mycompany\.com\\web.*\.config"
Error Code: ERROR_CERTIFICATE_VALIDATION_FAILED
More Infenter code hereormation: Connected to the remote computer ("<hostip>") using the specified process ("Web Management Service"), but could not verify the server's certificate. If you trust the server, connect again and allow untrusted certificates. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.
Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Error: The remote certificate is invalid according to the validation procedure.
Any idea what I am missing?
Adding <AllowUntrustedCertificate>True</AllowUntrustedCertificate> to my pubxml file seemed to fix the problem initially.
Upon re-publishing days later though, I got the same error. I went into the Publish Settings, re-entered my password and the publish succeeded.
I'm now thinking my initial problem was solved by re-entering my password, not by adding <AllowUntrustedCertificate>True</AllowUntrustedCertificate>.
-allowUntrusted did not worked for me.
I used this:
/p:AllowUntrustedCertificate=True
Adding this solution as none of the others worked for me...
I had to add these lines to publish profile:
<UseMSDeployExe>True</UseMSDeployExe>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
After adding those, publish still failed. Then I opened the publish profile settings, clicked validate connection, and saved. Only then did publish succeed.
I fixed this by going into the publish settings, then clicking "Validate Connection" at the bottom. Then this error goes away.
The problem was with the password for the user on the destination system.
I saw on another post that someone moved the -allowUntrusted flag before the -dest entry. I tried that and I started getting a ERROR_USER_UNAUTHORIZED message. Everything was correct with the password as it was entered, but it started with an * character and also had a single quote in it. I generated a new password for the user that didn't use those special characters and changed it on the remote system. After that, everything worked fine.
I was able to run the command as shown in the initial post without any error.
If you are getting a ERROR_CERTIFICATE_VALIDATION_FAILED or ERROR_USER_UNAUTHORIZED and everything is set up properly, try changing the password assigned to the user on the destination system. It would seem that some passwords just won't work.
Another Potential Solution - Deploying Web Jobs specifically
I know this is an old post, but I ran into this issue with VS 2019 when deploying my Azure Web Jobs. None of the above worked for me. What did end up working was re-authenticating using the tooling after updating the publishing profile. The way I resolved it was by right clicking the solution and selecting "Publish as Azure Webjob.." Even after creating a new publishing profile it still failed. I then added the following my publishing profile.
<_DestinationType>AzureWebSite</_DestinationType>
<UseMSDeployExe>True</UseMSDeployExe>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
I tried publishing it again and it failed. Then I re-authenticated by clicking the edit password link shown below.
When you do, you'll see the following screen. Click on the "Attempt to retrieve credentials from Azure" link.
Don't forget to hit the save button at the bottom after retrieving the creds from Azure. Once you do, go back and try publishing again. It should work just fine.
NOTE: If you just pulled down/created your publishing profile for the first time, do not click the edit button under the name of the Publishing profile and validate the connection that way as shown below.
If you do, it may remove the username/password from the UI for the publishing tooling shown in my first image above. If it disappears, you need to start this process all over again by deleting your profile, creating a new one and finally following the steps above in order. I don't know why it does this, but just something I noticed.
I notice you used the IP address for the deployment server:
-dest:iisApp="mycompany.com",ComputerName="https://<hostip>:8172/MsDeploy.axd"
This caused the certificate validation error for me because the SSL certificate was issued for the domain name, not the IP address. Changing to domain name instead of IP address fixed it.
Just want to add my 50 cents and my solution so it may help someone else.
what i did yo solve this is to use remote desktop to connect to the host machine
and when asked to accept the machine certificate ( after input login and password ) i marked remember this at the bottom.
hope this help someone

Vtiger error message "Sorry! Attempt to access restricted file." and illegal request

I am trying to migrate from one server with vTiger 6.0 to a new server with vtiger 6.2.
I complete the installation and also i move the database from the old server and no problems in those parts.
The errors come when i try to login, if i try to login with my user i get the error
"Sorry! Attempt to access restricted file"
and when i try to login with the admin account i get a lot of illegal request messages, i do get the vTiger GUI but if i click in one option menu i get a illegal request and if i logout it displays the next message
"{"success":false,"error":{"code":"Illegal request","message":"Illegal request"}}"
i'm new to Vtiger and i don't know why is this happening.
Some extra info i have try to check the path directory and seems to be right, the database data is right too it recognize the users when you log in just doesnt show anything but an error.
When i finish the installation i could enter with no problem the problem start when i uploaded the Database.
Also i want to access to enter from another computer, do i need to enable port 8888 on the server?
I am using a localhost and from that pc i want to acces from another pc.
Illegal request error is due to the improper CSRF validation. Please make sure that your browser url is same as your $site_URL in config.inc.php file .
config.inc.php file you will get from your Directory following below path --
C:\Program Files (x86)\vtigerCRM620\apache\htdocs\vtigerCRM\config.inc.php
In that file change $site_URL from 'http://localhost:8888/'; to 'http://1.6.2.12:8888/'; (1.6.2.12 is your machine IP)
This process will make your machine "1.6.2.12" into server for Vtiger application, so your application will be hosted on server 1.6.2.12 and then you can access this application on other computer also.
Port-8888 is used by Apache which is inbuilt in Vtiger by default so don't make any changes in that.
If you've migrated your data then try checking /vtiger/user_privileges/
There should be 2 files for each user: user-privileges-.php and sharing-privileges-.php (admin will be 1)
These can become lost and/or have dodgy permissions after migration, has happened twice to me. For some reason, Admin always copies over and works.
From your backup, take the related user files in /vtiger/user_priveleges/ and put them in new working folder and set permissions to read/write.
Make sure you transfer all files in /user_privileges because they are generated by sharing rules system in vTiger should be transferred like database.

Upload vCard (.vcf) file to IIS7 Site

I'm trying to upload a vcard file to a site i've built with ASP.NET. It's hosted on an IIS7 server.
I keep running into the "content type not allowed" error when i try to upload the file. I have write permission to the directory, I've already added the MIME type for vcards and restarted the IIS server, however it still refuses to take it.
I'm using DevExpress UploadControl and i've removed any validation from it so i am fairly certain the control is not restricting the file upload.
Any other suggestions ?
Maybe your component just allow some content types by default and new ones must be granted access manually.
Can you to debug your server side code, to see if your page code executes and to spot exactly what component are throwing up that error?
It's an HTTP error or a .net exception?

Resources