File upload error on mac browser not PC browser - browser

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at
System.Drawing.Image.Save(String filename, ImageFormat format) at
System.Drawing.Image.Save(String filename) at
Content.btnAddImage_Click(Object sender, EventArgs e) in
d:\inetpub\vhosts\rhinoreview.com\httpdocs\Content.ascx.cs:line 543
This process works perfect on any browser on a PC but does not work at all on any browser on a mac osx. A little lost on this one....

Nitpicking: it looks more like a download problem (from server to client) than an upload one (client sending a file to server).
Even more nitpicking: for me, PC means just Personal Computer. So computing running Mac OS or Linux or BSD or BeOS are just PC. I guess you mean PCs running Windows.
Wild guess, to add some value to this message: do you send the right headers along with the image?
It is hard to debug from the little info you provide (no code, no indication of language (C# likely) in the tags, etc.).

Wild guess, but it might be related to file extensions (it seems like GDI+ is failing when trying to convert the uploaded image to something it understands). I don't think Mac OS X needs them; are you uploading an image that doesn't have a file extension?

Related

How to get the default icon for a file in NodeJs?

I am creating a file explorer in NodeJS.
My question is, how do I find or get the icon for a file, like they do in Windows File Explorer.
I understand that this may be different for each OS, so a separate answer for each OS would be ideal (or just Windows would also be fine for now).
I'm sure it's possible from this: How to get the default system icon for a drive, a device or a file
However, that uses delphi and I am finding very confusing to understand their code.

Flash Actionscript : Flash swf not loading from global servers

I have written a simple program in actionscript that displays a line.
Here is the AS code
import flash.display.Graphics;
var g:Graphics=graphics;
g.lineStyle(1,0,100);
g.lineTo(100,100);
I published this code in flash CS5 and received corresponding SWF and HTML file.
When I upload these files to a local server then the swf file is loaded properly and the line is displayed.
But when I uploaded it to any of the global servers like goDaddy the flash stopped working. Nothing was displayed on the screen.
On right clicking the flash panel it showed a message "movie not loaded".
And the strange fact is that its not happening on all systems. On some computers this flash is working fine.
Any idea what could be the reason?
Are you using the exact file name in your invoking HTML even for lowercases an uppercases? In Windows and Macintosh desktop computers or Windows Servers these differences are not important, but on linux servers, files like MYFILE.SWF are not the same than myfile.swf or MyFile.swf

Character Encodings when switching from Linux to Windows

I created a tex-file on Ubuntu. Now I upload the file via FTP on an Apache-Webserver. I am pretty sure, that the server is a unix-based server. After that I download the file from the webserver and I open it with JEdit on Windows-7 and german umlaute (ä, ö, etc.) are looking strange.
I thought: if I change the file-attributes in JEdit to UTF-8 all should be fine, but nevertheless, umlaute are still looking strange.
How can I handle the file-encoding dilemma?
Thanks in advance.
Go to Settings -> Transfers -> File Types in FileZilla and set to binary for the extension you're using for your text file.
If you're using the command line clients, try binary to switch to binary mode.

How can I open a local file with a local program through my browser?

On my webpage, I have placed a link to a local file (e.g. "text.docx" on my local HD). I would like to double click on this link, and have a third party software which is installed locally on my PC (e.g. Microsoft Word) open it.
I would like to be able to do this with Firefox and Google Chrome. Obviously, I am a newbie to web programming.. can somebody show me the way? I have looked around and had the impression that I need to write and add an extension, maybe?
Thanks for your time. Jakob
This is only possible if you know either the absolute path to the file or the relative path from whatever working directory your browser runs from. You the create a link with
href="file://relative/path/to/file/text.docx"
or
href="file:///absolute/path/to/file/text.docx"
and any modern browser will query the system database for the mimetype of the file depending on its extension, thus prompting to open the correct application.
EDIT
I inawarently introduced a unixism in the previous code: Distinction bewteen absolute and realtive paths as above works well on current *nix desktops, but in Windows an absolute path will most likely look like
href="file://C:/drive/absolute/path/to/test.docx"
Mind the 2 (not 3) slashes a the beginning, and the forward (not backward) slashes.
As far as I know, you can't link to local files from a website. If you upload it to where your files are, you could then be able to download it.
I was able to execute code locally, using Firefox, by adding an extension which used the XPCOM interface. One such extension was "commandrun", and may be found here: https://github.com/aabeling/commandrun .

linux script to dump web page from a browser to image file

Fo you know any script to make a screenshot of rendered web browser contents to an image file?
For now I've tried:
wkhtmltoimage - doesnt dump flash
cutycapt - problems to compile on my hosting
khtml2png - problems with compilation
At home I'm using Ubuntu, hosting is on Debian
Never got around to trying myself, but check out http://en.wikipedia.org/wiki/Xvfb. You should be able to run Firefox in xvfb and just save an image of the whole virtual window.
The xwd(1) program can capture a running browser window's contents and save it to a file or stdout:
xwd -out /tmp/image.out
You can view it again with xwud(1).
The ImageMagick import(1) command can also capture X11 windows or any rectangular portion of the screen. It also supports many output file formats, which might be nicer than the standard xwd format.
PDFMyURL - really useful except bug with header sending. They have
simple "API". Unless you need simple grab the screen from WebKit, it
is best solution IMHO
If you have own VDS, I recommend to discover PhantomJS See rasterize.js
UPD: I have just seen this is necropost Z)

Resources