Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Basically,

 

I am developing part of an intranet and I am trying to allow people to upload images to a directory on a server... however, the window that contains the file selection and submit button (which pops up when you click a button on the main html intranet page), needs to return the file path for the image in its new location!. This seems to cause problems with all the upload examples I have seen, as they all want to pass on parameters again to another function. All i want is a very simple upload function that will upload all images to a directory ("~/images/").

 

CAN SOMEONE HELP ME OUT AND SHOW ME HOW TO DO THIS... i have been looking at it all day and my head is killing... sounds easy.... but not when you are a novice and you dont know how.

 

My code for my pop up window with the file selection box and submit button is attached..... i dont think it matters whether it is a .asp or .html file... i was just trying a few things out.

 

Cheers,

Stu

imagepicker.zip

Posted

Just to make things clear...

 

Just to make things clear... as i have re-read what i put, and it isn't that clear.

 

From the users point of view...

 

You click on insert button on the main intranet page... this takes you to the new pop up window (code attached) with the file selection box, and submit (upload) button.

 

Then once this has been uploaded, the pop-up window automatically closes and its passes back the location of where the image is stored now... to the main intranet page... so my funstion in there can use it.

Posted

Are you using ASP or ASP.NET?

 

Once file has been uploaded, how do you show in your main intranet page? you direct pass value to control like textbox? or just display it as normal text (this request you to reload the page)?

 

I not quite understand why you need pop up window... is it similar to Yahoo Mail when we want to attach file?

Posted

ASP.NET

 

Yes its like yahoo.

 

its needs to return the location of the new image to the main intranet page too. Thats why my code has got a return at the bottom.

Posted

I did a upload function in ASP, in ASP.NET I never do that, but as what I know, ASP.NET provide classes for upload feature, not like ASP, we need to write our own function. I think it is not difficult for you to find upload function in ASP.NET, just try to search for it or VS .NET help.

 

Return value to main intranet page is rather simple, you can direct pass to textbox without reloading your main page using javascript or any scripting language.

 

In javascript is something like this if I not mistaken (in sub window):

 

[javascript]

parent.opener.form1.textbox.value = myPath

[/javascript]

 

You get what i mean?

Posted

Would be much appreciated...

 

However the posted code (above) does work... the only thing that it does not do... which i need it to do now... is for the saveupload.asp file to pass back the new location of the image all the way back to the main intranet page. I presume that the way that it would need to do this is to return it to the UploadPicker.html page, and then for that in turn to pass it back to the intranet page? (as that is the exact opposite to the way they were originally called).

 

If anyone could have a look it would be appreciated.

 

stu.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...