473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

changing upload folder for images

229 New Member
Hi, I wonder if anyone could tell me if there is a default upload folder for image uploads in this code or if the code references another file. It works fine but I am trying to change the upload folder for images and cannot find where its done.

This bit confuses me as the application gcp, I simply dont know where it is. The only include in this page is just an upload include that has no other includes in it.
If anyone can explain the application bit that would be great.
Thanks
Richard

strFileUploadPa th=Application( "gcp_PathImageU ploads")


Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.     <!--#Include File="upload2.asp"-->
  4.  
  5. ' Create the FileUploader
  6. Dim Uploader, File
  7. Set Uploader = New FileUploader
  8.  
  9. 'On Error Resume Next
  10.  
  11. ' This starts the upload process
  12. Uploader.Upload()
  13.  
  14. ' Check if any files were uploaded
  15. If Uploader.Files.Count = 0 Then
  16.     Response.Write "No file(s) have been uploaded."
  17. Else
  18.  
  19.     ' Loop through the uploaded files
  20.     For Each File In Uploader.Files.Items
  21.  
  22.             ' Save the file
  23.             strFileUploadPath=Application("gcp_PathImageUploads")
  24.  
  25.             'check if file exists
  26.             strFileNameTemp=""
  27.             set fs=Server.CreateObject("Scripting.FileSystemObject")
  28.             If fs.FileExists(Application("gcp_PathImageUploads") & File.FileName)=True Then
  29.                 Dim MyNewRandomNum
  30.                 Randomize
  31.                 MyNewRandomNum = int(Rnd * 198300)+1
  32.                 strFileNameTemp=MyNewRandomNum & File.FileName
  33.                 File.FileNameNew strFileNameTemp
  34.             Else
  35.                 strFileNameTemp=File.FileName
  36.             End If
  37.  
  38.  
  39.             File.SaveToDisk strFileUploadPath
  40.             FileContentType1=File.ContentType
  41.             FileSize1=File.FileSize
  42.             If Trim(FileName1)<>"" Then
  43.                 FileName1=FileName1 & ","
  44.             End If
  45.             FileName1 =FileName1  & File.FileName
  46.             strFileName=Application("gcp_URLImageUploads") & FileName1 
  47.  
  48.     Next
  49. End If
  50.  
  51. If Err.Number>0 Then
  52.     Response.Write "Error Number: " & Err.Number
  53.     Response.Write "<br>Description " & Err.Description
  54.     Response.write "<br>There is no specified upload folder."
  55. End If
  56.  
  57. If Err.Number>0 Then
  58.     strMessage="There is no specified upload folder."
  59.     Response.End
  60. End If
  61.  
  62.  
  63. %>
Apr 20 '09 #1
2 2166
jhardman
3,406 Recognized Expert Specialist
Richard,

It looks like the code in question is in the upload doc, but it also looks like some odd object is being created, and I'd be surprised if that is in the include file.

Jared
Apr 21 '09 #2
fran7
229 New Member
Thanks Jared, Thanks. No you are right it wasnt. It was in another file. I worked around it by quering the "URLImageUpload s" field in the database right from the page itself. Worked anyway!
Thanks
Richard
Apr 24 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3716
by: Dean | last post by:
First I've must say Im completly new in php scripting What I need to do is upload, resize pictures with path in database Here is theory of it, and plan of doing it Hope somebody can help me here are 4 sizes of images:
4
2413
by: NohaKhalifa | last post by:
Dear All; I'm developing a web site and i need to make adminisration for this site it's a site for Real Estates . But I don't need the administration to be online .. I want them to fill data and images offline and then send them online... but i have a problem regarding the images i want it to be sent to the web site So i want if there...
2
6050
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet server. On the line: dirs = Directory.GetDirectories(currentDir) I get "Access to the path "\\les-net\les\Special Projects\ATSPDF" is denied." ...
1
2750
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp" as the directory. When I use any other hard coded directory or even Server.MapPath() the upload function fails and returns the error: "Exception has...
0
4742
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle verdiği hata şu.Bilen arkadaşlar lütfen yardım edin Persits.Upload.1 error '800a0020' The system cannot find the path specified. ...
2
1571
by: puja | last post by:
hi all, I have website build using c# where I have 3 images in my homepage. I have a table called images where I store the physical path of all 3 images. eg: Image1 --> C:\StoreImages\User1\Image1.jpj Image2 --> C:\StoreImages\User1\Image2.jpj Image3 --> C:\StoreImages\User1\Image3.jpj When my website loads, I read this table to...
9
3819
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. ...
6
2199
by: Emmanuel Petit | last post by:
First of all I am rather new into PHP. I use php 5 and I am putting together a web site for a local association I belong too. Most of the site is okay, except for this problem : I need to be able for the member of the site to upload files (gif, jpg or pdf). After reading a lot about the danger of file uploading, I decided to create a folder...
5
3270
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is _uploadedfiles_xxxx) (php must be allowed to move uploaded files to this folder' - uploadedfiles_xxxx. I typed <?php chmod ('_uploadedfiles_xxxx',640);...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.