No error message available, result code: E_FAIL(0x80004005) - asp.net

My application uses windows authentication. user login with their username/password and upload an excel sheet.
The issues is while uploading the excel ,one user able to upload the excel file but another user get an error:
No error message available, result code: E_FAIL(0x80004005)
The code is same. I don't know what's the actual problem is? Please Help?

Not 100% sure, but can you check:
The user has permissions on the folder where the excel is uploaded.
If you are using OleDBCommand, and the file name is invalid then too you might get same error.

// User was neither granted nor denied read access.
// Pass the callback method the integer
/// value of E_FAIL.
hr = unchecked((int)0x80004005);
This is how the implementation of return value usually goes. The comment may point you the possible problem.

Only Temporary solution:- 1) If you try to upload same file name multiple times this problem will raise. So try to upload distinct file name every time.

I had same problem now got the solutions,
1 => Timeout
(try to insert or update part by part)
2 => Cannot Overwrite
if you trying to create a sheet with same name...

Related

ABAP AL11 directories not visible

I got a problem since the update on EHP8 for SAP.
We got many directories under the main directory "transfer.test/te11/" but since the update we can´t see the directory anymore if "S_DATASET" doesn´t have the entry in filename like this "transfer.test/te11*".
For some people the authorisation object "S_DATASET" contains the filename "transfer.test/te11/test*" but they don´t see anything neither the entry for the main directory nor the subdirector which they are authorisated in AL11.
Does somebody have an idea ? SU53, authorisation check, doesn´t through an error.
Greetz
The "solution" that we did was in the authorization object S_DATASET . There we could insert a value from...to and I did it with from "transfer.test/te11" to "transfer.test/te11" and another value for "transfer.test/te11/test*" that helped.

SilverStripe 4.1 Email->addAttachment()?

I have a contact form that accepts a file input, I'd like to attach the file to the email that gets sent from the form.
Looking at the API reference isn't really helping, it states that the function expects a filepath with no clarification on anything beyond that.
The submit action will save a record of the into the database and this works correctly, something like:
$submission = MyDataObject::create();
$form->saveInto($submission);
$submission->write();
an Email object then gets created and sent. Both of these are functioning and working as expected.
Trying to attach the File I've tried:
$email->addAttachemnt($submission->MyFile()->Link());
which is the closest I can get to getting a filepath for the document. Dumping and pasting the resulting filepath being output by that call will download the form but that line throws an error and can't seem to locate the file.
I suspect that I'm misunderstanding what's supposed to be given to the function, clarification would be very much appreciated.
P.S. I don't currently have access to the code, I'm looking for some clarification on the function itself not an exact answer :).
In SilverStripe 4 the assets are abstracted away, so you can't guarantee that the file exists on your webserver. It generally will, but it could equally exist on a CDN somewhere for example.
When you handle files in SilverStripe 4 you should always use the contents of the file and whatever other metadata you have available, rather than relying on filesystem calls to load it.
This is how the silverstripe/userforms module attaches files to emails:
/** #var SilverStripe\Control\Email\Email $email */
$email->addAttachmentFromData(
$file->getString(), // stream of file contents
$file->getFilename(), // original filename
$file->getMimeType() // mime type
);
I would try $email->addAttachment($submission->MyFile()->Filename); If it doesn't work, you may need to prepend $_SERVER['DOCUMENT_ROOT'] to the filename.
$email->addAttachment($_SERVER['DOCUMENT_ROOT'] . $submission->MyFile()->Filename);

Goutte / Web Scraping - How to intercept and download a file

Firstly, thanks in advance for your help here, it's really appreciated!
I've successfully managed to get Goutte to authenticate, hit a URL, change a select field and click a submit button.
The page then reloads and as it finishes loading, it downloads a file to the client.
How do I intercept this file within Goutte? I've read as much doco as I can but can't seem to find an answer. I then want to basically hit this file, traverse it and save it locally.
Depending upon the file type, I want to traverse it, or save it locally.
Thanks :-)
It is not easy to achieve this. In my situation, I open the URL where the file is (after authentication) then the server gives the file (as an object of Page), afterwards you can get the content of the page.
// $url contains the path to the file.
$session->visit($url);
$page = $session->getPage();
$saved = file_put_contents($targetFilePath, $page->getContent());
In my case, I am downloading zip file. In your case, probably save it in a temporary location, detect the type then move it to any desired directory.
Hope this helps.

How to create a User in Alfresco?

I tried creating a user. But when I tried, it displayed the following error:
Failed to create the user: 05190030 Wrapped Exception (with status template): 05192817 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/repository/person/people.‌​post.json.js': Non-unique path:found : /app:company_home/app:user_homes 0." I am new to Alfresco. Can anyone help me?
This pretty much sounds like you try to create a user which already exists (username property is unique).
As stated in my comment to your other question, it's a known issue when you move, delete or rename User Homes.

Error: is not a valid virtual path

I used something like
Dim i As String
i = Server.MapPath("~/photos/") + fileName
Only once in a project that was working and online, on the offline version, when I run it on my machine, its working, no errors, I uploaded it, it gave me an error like:
'~/photos/http://www.MyURL.com/photos/4411568359267Pic003.jpg' is not a valid virtual path.
Indicating a line in my code:
var marker = new GMarker(new GLatLng(<%=coordinates%>));
This have never happened before, and I don't know where to start troubleshooting as this script -Google Maps- doesn't even need images, i tried to comment it out, it gave me the same error but on a different script this time, the one that show formatting toolbar for the text areas
Line 8: new nicEditor({buttonList : ['fontSize','fontFamily','fontFormat','bold','italic','underline','strikethrough','forecolor','bgcolor','removeformat'], iconsPath : '../nicEdit/nicEditorIcons.gif'}).panelInstance('<%= txtDescription.ClientID %>');
..please HELP :'(
can you post your fileupload aspx page and your function so we can troubleshoot it.
"'~/photos/http://www.MyURL.com/photos/4411568359267Pic003.jpg'"
look closely at the url, it is tacking the full url on to "i". what type of control or you using, a generic or a server side control
solved, turns out the error is due to old database records when i was storing the whole path in the fileName...Thanks Joshua and Keltex

Resources