I have another problem: what if somebody copy pastes an image fr om a web browser?
The image has in src address like " ere.com/picture.jpg".
I'm trying to get these pictures but I get the 404 not found error... however the HTML in preview (string field which is displayed as HTML in form) is displaying just fine!
The code I'm trying to use:
Code
HTMLReader = New HTMLReader;
HTMLReader.SetString(HTMLText);
DOMBuilder = New DOMBuilder;
HTMLDocument = DOMBuilder.Read(HTMLReader);
ImgItems = HTMLDocument.GetElementByTagName("img");
For Each Img In ImgItems Do
If Left(Img.Src, 4) = "http" OR Left(Img.Src, 4) = "HTTP" Then
FileNumber = Format(CurrentDate(), "DF=""yyyyMMddHHmmss""");
inputFile= TempFilesDir() + "1Cimage"+FileNumber;
НТТР = New HTTPConnection(Img.Src);
НТТР.Get(Img.Src, inputFile); // Get gives 404 error
Address = TempFilesDir()+"1Cimage"+FileNumber;
MessagePictures.Add(Address,"1Cimage"+FileNumber);
HTMLText = StrReplace(HTMLText, Img.Src, "1Cimage"+FileNumber);
EndIf;
No, I'm pretty sure that the given .htaccess redirection is the only one, when I removed these lines from .htaccess then the script could get the file without problems.
Pages:1
Users browsing this topic (guests: 1, registered: 0, hidden: 0)