473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

open a new page with images as param

Hi all,

I'm stuck with some php code that runs out of time limit. This is due to a
long XML file process that has to save pictures on the disk.

What I've now:
- read XML file
- parse XML file
- for every article
- save datas in Database
- save pictures on harddisk
- save path on hardisk
delete XML file

What I'd like to do:
- read XML file
- parse XML file
- for every article
- save datas in Database
- call the savepictures script with images as param
delete XML file

the savepictures scipt:
- save pictures on harddisk
- save path on hardisk
- close itself

My question are:
1- it is possible to call such "savepictures" script using javascript (I
can't use Exec on my ISP).
2- if yes, how can I give the images as parameters ? They are actually
base64 encoded in an array and I save them using
fwrite($imgfile,base64_decode($picarray[$I]));
3- will this be a "blocking" process (the script must wait the new window to
open in order to continue running)

Thanks for help.

Bob

Dec 5 '06 #1
4 1948
Bob Bedford wrote:
Hi all,

I'm stuck with some php code that runs out of time limit. This is due to a
long XML file process that has to save pictures on the disk.

What I've now:
- read XML file
- parse XML file
- for every article
- save datas in Database
- save pictures on harddisk
- save path on hardisk
delete XML file

What I'd like to do:
- read XML file
- parse XML file
- for every article
- save datas in Database
- call the savepictures script with images as param
delete XML file

the savepictures scipt:
- save pictures on harddisk
- save path on hardisk
- close itself

My question are:
1- it is possible to call such "savepictures" script using javascript (I
can't use Exec on my ISP).
2- if yes, how can I give the images as parameters ? They are actually
base64 encoded in an array and I save them using
fwrite($imgfile,base64_decode($picarray[$I]));
3- will this be a "blocking" process (the script must wait the new window
to open in order to continue running)

Thanks for help.

Bob
Hi,

Kind of strange question in a JS newsgroup.
Javascript cannot really help here, because the saving of pictures is a
serverside (PHP) action.
You can of course let JS pass the locations of the images to some php-script
in the form of http://www.example.com/images/myimage.png
and let PHP open that picture, stream it into memory, and save it in the
database.
PHP can open a file on the net simply with fopen(), and it will figure out
itself it needs a http-wrapper.

Regards,
Erwin Moller
Dec 5 '06 #2
Hi,
>
Kind of strange question in a JS newsgroup.
Javascript cannot really help here, because the saving of pictures is a
serverside (PHP) action.
You can of course let JS pass the locations of the images to some
php-script
in the form of http://www.example.com/images/myimage.png
and let PHP open that picture, stream it into memory, and save it in the
database.
PHP can open a file on the net simply with fopen(), and it will figure out
itself it needs a http-wrapper.
Hi Erwin,

thanks for replying.

Actually my question is how to open a new window passing as param the images
array using javascript, as I can't use Exec or fpassthru or likes
(disallowed by ISP).

I'd like to know how to do something
window.open('newscript.php?imagearray'). passing the array of base64 encoded
files is also something I don't know how to do. It's a pure javascript
question, as the PHP part is known.

Bob

Dec 5 '06 #3
Bob Bedford wrote:
>Hi,

Kind of strange question in a JS newsgroup.
Javascript cannot really help here, because the saving of pictures is a
serverside (PHP) action.
You can of course let JS pass the locations of the images to some
php-script
in the form of http://www.example.com/images/myimage.png
and let PHP open that picture, stream it into memory, and save it in the
database.
PHP can open a file on the net simply with fopen(), and it will figure out
itself it needs a http-wrapper.
Hi Erwin,

thanks for replying.

Actually my question is how to open a new window passing as param the images
array using javascript, as I can't use Exec or fpassthru or likes
(disallowed by ISP).

I'd like to know how to do something
window.open('newscript.php?imagearray'). passing the array of base64 encoded
files is also something I don't know how to do. It's a pure javascript
question, as the PHP part is known.

Bob

When you open a child window, the data of the parent is still accessible
.. Lets say you have...

var myimg = new Image()
myimg.src='some.gif';

Now pop a new window and you should be able to access that original
image as parent.myimg . So you don't really need to pass the actual
image, you just need to pass the array location where the image you want
to process happens to reside.

Note that I haven't tested this and it's been a long time since I've
done cross-window/frame communications since ajax and DHTML makes
popups/frames outdated. The syntax may be off but I do know that it's
possible.

--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA
Dec 5 '06 #4
ASM
Bob Bedford a écrit :
Actually my question is how to open a new window passing as param the images
array using javascript, as I can't use Exec or fpassthru or likes
(disallowed by ISP).
I understand the image to save is previously displayed on main page.
true ?

I understand you know how to get it by browser's tree of images (images
array)
true ?
I'd like to know how to do something
window.open('newscript.php?imagearray'). passing the array
You want to pass the document images array in its totality ?

function popImgs()
var I = new Array();
for(var i=0;i<document.images.length;i++)
I[i] = document.images[i].src;
window.open('newscript.php?imagearray='+I);
}

Every address of image separated from its neighbours by , (coma ?)

of base64 encoded
files is also something I don't know how to do.
doesn't browser encode directly by default in base 64 ?

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Dec 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
35
by: .:mmac:. | last post by:
I have a bunch of files (Playlist files for media player) and I am trying to create an automatically generated web page that includes the last 20 or 30 of these files. The files are created every...
5
by: A.M | last post by:
Hi, My ASP.NET application uses SSL on IIS6. up on visiting some pages, IE 6 shows this security alert: This page contains both secure and non secure items. Do you want to display non-secure...
7
by: GaryDean | last post by:
In my old 1.1 apps the default was MS_POSITIONING="GridLayout" and Textboxes and labels and such always had POSITION: absolute; and I never had any distortion when the page was rendered. Life was...
1
by: pstrand2000 | last post by:
My page uses a horizontal navigation bar that requires a JavaScript file to force IE to do hovers. It worked great in both Fire Fox and IE until some Flash code was added. This is how the Flash...
7
by: Ben Amada | last post by:
Hi ... I have an HTML page containing a bunch of <alinks. Some of the links redirect the visitor to a page at a different website in a new browser window (target=_blank) and other links are...
10
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi, Please help me to write a dll in C# , that will read each pages of a tiff image from a file and a memory stream object ( need two ways) and creatre a new tiff image object.The dll should...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.